DataZone Cloudformation Stack

0

Hi, I'm trying to create a DataZone Setup through Cloudformation templates. I've cretaed the DataZone domain, project and Envrionment Blueprint Configuration, however, when trying to proceed with Environment profile, I get this error:

"Properties validation failed for resource AdviceClientEnvironmentProfile with message: #/ProjectIdentifier: failed validation constraint for keyword [pattern] #/EnvironmentBlueprintIdentifier: failed validation constraint for keyword [pattern]"

This is how I'm trying to define my resource:

AdviceClientEnvironmentProfile: DependsOn: AdviceClientBlueprintConfig Type: AWS::DataZone::EnvironmentProfile Properties: AwsAccountId: !Ref AWS::AccountId AwsAccountRegion: us-east-1 DomainIdentifier: !Ref AdviceDomain EnvironmentBlueprintIdentifier: !Ref AdviceClientBlueprintConfig Name: advice_environmentprofile ProjectIdentifier: !Ref AdviceClientProject

Kindly suggest where the template is going wrong.

Thanks, Diksha

Diksha
asked 4 months ago262 views
1 Answer
1

Hi,

As per documentation, EnvironmentBlueprintIdentifier must match a given pattern that you !Ref AdviceClientBlueprintConfig doesn't probably follow. Hence the error message that you get.

See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datazone-environmentprofile.html#cfn-datazone-environmentprofile-environmentblueprintidentifier

EnvironmentBlueprintIdentifier
The identifier of a blueprint with which an environment profile is created.
Required: Yes
Type: String
Pattern: ^[a-zA-Z0-9_-]{1,36}$

Investigating a bit further, you cannot use !Ref AdviceClientBlueprintConfig as EnvironmentBlueprintIdentifier because based on docs of AWS::DataZone::EnvironmentBlueprintConfiguration, !Ref functions returns DomainId|BlueprintConfigurationId with a pipe character (i.e. | ) in the middle. This char is not allowed by the pattern above.

See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-datazone-environmentblueprintconfiguration.html#aws-resource-datazone-environmentblueprintconfiguration-return-values

So, adapt !Ref AdviceClientBlueprintConfig (=parse it to remove |) to match this pattern or use another identifier and your issue will be solved.

Best,

Didier

profile pictureAWS
EXPERT
answered 4 months ago
  • Hi, Thanks for pointing out where I was going wrong. So, now I'm trying to get the 'EnvironmentBlueprintIdentifier' using Fn::GetAtt: - AdviceClientBlueprintConfig - EnvironmentBlueprintIdentifier But still it doesn't work. Can you please suggest how can I make this work?

    I get this error: "Requested attribute EnvironmentBlueprintIdentifier must be a readonly property in schema for AWS::DataZone::EnvironmentBlueprintConfiguration"

    AdviceClientBlueprintConfig: Type: AWS::DataZone::EnvironmentBlueprintConfiguration Properties: DomainIdentifier: !Ref AdviceDomain EnvironmentBlueprintIdentifier: DefaultDataLake EnabledRegions: - us-east-1 - us-east-2

    AdviceClientEnvironmentProfile: DependsOn: AdviceClientBlueprintConfig Type: AWS::DataZone::EnvironmentProfile Properties: AwsAccountId: !Ref AWS::AccountId AwsAccountRegion: us-east-1 DomainIdentifier: !Ref AdviceDomain EnvironmentBlueprintIdentifier: Fn::GetAtt: - AdviceClientBlueprintConfig - EnvironmentBlueprintIdentifier Name: advice_environmentprofile ProjectIdentifier: advice_client

  • The right syntax is: !GetAtt AdviceClientBlueprintConfig.EnvironmentBlueprintId Best, Didier

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions