Cloudformation rule doesn't prevent stack creation

0

Hi,

Our cloudformation template requires user to enter the email, password and then confirm the password before creating the stack. We have cloudformation rule to check whether the password field and confirm password field are the same:

Rules:
  ConfirmPasswordsMatch:
    Assertions:
      - Assert:
          Fn::Equals:
            - !Ref AdminPassword
            - !Ref ConfirmAdminPassword
        AssertDescription: Passwords do not match

While it does render an error message below the password input field when two passwords are different, but it doesn't actually prevent user to create the stack. Even the password and confirm password are different, user can still successfully create the stack.

This is a blocker for us, because we want to use similar mechanism to validate other template parameters.

Using rule is the official validation mechanism , and we are doing in the same way.

질문됨 2년 전243회 조회
1개 답변
0

In the console, I just tested the below template, and it worked as expected. If the fields, didn't match, I was unable to proceed, if they did I was able to create a stack from the template.

AWSTemplateFormatVersion: 2010-09-09



Parameters:

    AdminPassword:

        Type: String

    ConfirmAdminPassword:

        Type: String



Rules:

  ConfirmPasswordsMatch:

    Assertions:

      - Assert:

          Fn::Equals:

            - !Ref AdminPassword

            - !Ref ConfirmAdminPassword

        AssertDescription: Passwords do not match

        

Resources:

    myVPC:

        Type: AWS::EC2::VPC

        Properties:

            CidrBlock: 10.0.0.0/16

            EnableDnsSupport: 'true'

            EnableDnsHostnames: 'true'

            Tags:

                - Key: stack

                  Value: test
AWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠