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
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ