Skip to content

feat: Add support for custom service environment blueprints#8

Merged
gyalai-aws merged 3 commits intocdklabs:mainfrom
PietropaoloV:main
Mar 11, 2025
Merged

feat: Add support for custom service environment blueprints#8
gyalai-aws merged 3 commits intocdklabs:mainfrom
PietropaoloV:main

Conversation

@PietropaoloV
Copy link
Contributor

Changes

  • Update environment.ts to take in environmentBluerprintIdentifier. This allows for support of custom service environment in datazone as this is a required field
  • Removed environmentRoleArn from environment-profile.ts since environment profile does not support this
  • Added custom service environment test
  • Updated documentation

Justification

https://docs.aws.amazon.com/datazone/latest/userguide/working-with-custom-blueprint.html
Custom Service Blueprints are unique in that they do not require environment profiles. They require the blueprint Id, and the environment account id, environment account region. They are a synchronous for of environment creation. Currently, there is a customer trying to use this package and cannot pass in the blueprint identifier, since custom service blueprints dont have an environment profile the environment creation in cloud formation fails. Below is a comparison between a working CFN template and one synthesized from this package before the above change

Synthesized with this library (Json)

{

  "Resources": {
    "TestDataZoneEnvironment": {
      "Type": "AWS::DataZone::Environment",
      "Properties": {
        "Description": "Automated test environment for AWS DataZone",
        "DomainIdentifier": "dzd_cv8vsjuej8xt0n",
        "EnvironmentAccountIdentifier": "624699565525",
        "EnvironmentAccountRegion": "us-east-1",
        "EnvironmentRoleArn": "arn:aws:iam::624699565525:role/Admin",
        "Name": "TestEnvironment",
        "ProjectIdentifier": "bdffz2y3yajvvr"
      },
      "DeletionPolicy": "Retain"
    }
  }
}

Expected Template to Work with CFN (Yaml -My Personal Preference)

Environment:

    Type: "AWS::DataZone::Environment"
    DependsOn: EnableBlueprint
    Properties:
      ProjectIdentifier: !GetAtt EnvironmentActionProject.Id
      DomainIdentifier: !GetAtt Domain.Id
      Description: "Testing Env for Env Action Integration tests"
      Name: "BaseEnvironment"
      EnvironmentBlueprintId: !GetAtt EnableBlueprint.EnvironmentBlueprintId
      EnvironmentAccountIdentifier: !Ref "AWS::AccountId"
      EnvironmentAccountRegion: !Ref "AWS::Region"
      EnvironmentRoleArn: !GetAtt EnvActionRole.Arn

Testing

  • All automated tests are passing'
  • Added additional test for environment creation with just custom blueprints

Author (Vincent Pietropaolo (vapp)) - Original developer of custom service blueprints for datazone (Both backend and CFN IAC code)

…is is required for custom aws service environments)

- Removed environmentRoleArn from environment-profile.ts since environment profile does not support this
@PietropaoloV PietropaoloV changed the title Update Environment.ts to take in EnvironmentBlueprintIdentifier (Expands Environment Creation to Support Custom Service Blueprint Environments) feat: Add support for custom service environment blueprints Mar 7, 2025
Copy link
Contributor

@gyalai-aws gyalai-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your improvements. All looks good. Now just the build needs to be fixed.

Can you run the followings the get the buiild passed, please?

npm run upgrade
npm run build

Vincent Pietropaolo added 2 commits March 10, 2025 08:39
…is is required for custom aws service environments)

- Removed environmentRoleArn from environment-profile.ts since environment profile does not support this
Copy link
Contributor

@gyalai-aws gyalai-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

@gyalai-aws gyalai-aws merged commit ec5b37c into cdklabs:main Mar 11, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants