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.

demandé il y a 2 ans229 vues
1 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions