aws-cloudformation / cloudformation-resource-schema

The CloudFormation Resource Schema defines the shape and semantic for resources provisioned by CloudFormation. It is used by provider developers using the CloudFormation RPDK.
Apache License 2.0
90 stars 38 forks source link

MWAA::Environment fails to create: "#/SourceBucketArn: failed validation constraint for keyword [pattern]" #114

Closed nigelellis closed 3 years ago

nigelellis commented 3 years ago

Hi,

I'm trying to create an MWAA Environment resource via. CloudFormation. When attempting to create the stack I receive an error:

Error: ROLLBACK_COMPLETE: ["The following resource(s) failed to create: [AirflowMWAA]. Rollback requested by user." "Properties validation failed for resource AirflowMWAA with message:\n#/SourceBucketArn: failed validation constraint for keyword [pattern]"]

Here's a snippet of my CF stack:

Description: airflow-head
Resources:
  AirflowMWAA:
    Type: AWS::MWAA::Environment
    Properties:
      ...
      SourceBucketArn: arn:aws:s3:::my-bucket-name
      ...
    DeletionPolicy: Delete

The bucket ARN is valid and is accepted if I create the env via. the MWAA wizard in the AWS console.
How can I fix this? The error is too terse to be useful.

Thanks, Nigel.

PatMyron commented 3 years ago

Those messages are definitely currently difficult to interpret without looking at the resource schema itself:

      "minLength": 1,
      "maxLength": 1224,
      "pattern": "^arn:aws(-[a-z]+)?:s3:::airflow-[a-z0-9.\\-]+$"

but it looks like the bucket name needs to start with airflow-

nigelellis commented 3 years ago

@PatMyron thank you! I'll give that a try.