Skip to content

馃馃馃 r/aws_datazone_environment_blueprint: New resource - #50607

Open
mvincentbb wants to merge 9 commits into
hashicorp:mainfrom
mvincentbb:f-datazone-environment-blueprint
Open

mvincentbb wants to merge 9 commits into
hashicorp:mainfrom
mvincentbb:f-datazone-environment-blueprint

Conversation

@mvincentbb

Copy link
Copy Markdown

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

None.

Description

Adds a new resource, aws_datazone_environment_blueprint, for creating and managing a custom Amazon DataZone environment blueprint (CreateEnvironmentBlueprint). The provider already has aws_datazone_environment_blueprint_configuration (enables an existing blueprint) and the aws_datazone_environment_blueprint data source (looks one up), but no resource to create a custom blueprint.

  • Arguments: domain_identifier and name are required and force replacement. provisioning_properties.cloud_formation.template_url is required. description and user_parameters are optional and update in place.
  • Computed attributes: id, blueprint_category, created_at, glossary_terms, provider_name, updated_at.
  • description / user_parameters removal: UpdateEnvironmentBlueprint keeps omitted fields. The resource sends "" when description is removed and an empty list when user_parameters is removed, so removal reaches the API.
  • Update gating: a timeouts-only change does not call UpdateEnvironmentBlueprint.
  • Resource identity: parameterized identity on domain_identifier and id. Import supports both identity and the domain_identifier,id ID.
  • Sweeper: deletes custom (managed = false) blueprints in each domain. It is registered as a dependency of the domain sweeper, so blueprints are removed before their domain.

AI usage disclosure

  • An AI coding agent (Kiro) helped me write the resource code, the acceptance tests, the docs, the sweeper and the changelog entry. It followed the existing DataZone resources as patterns.
  • I used OpenAI Codex /review on the branch twice before opening this PR and I fixed its findings.
  • I reviewed every line. I ran the acceptance tests against a real AWS account (output below), plus gofmt, vet, semgrep, providerlint and copyright checks.
  • I take full responsibility for this change and can explain it in my own words.

Relations

Closes #50433

References

Output from Acceptance Testing

The identity tests skip locally (they need Terraform 1.12; my host has 1.9.8).

% make testacc TESTS=TestAccDataZoneEnvironmentBlueprint_ PKG=datazone

=== RUN   TestAccDataZoneEnvironmentBlueprint_Identity_basic
=== RUN   TestAccDataZoneEnvironmentBlueprint_Identity_regionOverride
=== RUN   TestAccDataZoneEnvironmentBlueprint_basic
=== RUN   TestAccDataZoneEnvironmentBlueprint_update
=== RUN   TestAccDataZoneEnvironmentBlueprint_disappears
=== RUN   TestAccDataZoneEnvironmentBlueprint_userParameters
    environment_blueprint_identity_gen_test.go:32: Terraform CLI version 1.9.8 is below minimum version 1.12.0: skipping test
--- SKIP: TestAccDataZoneEnvironmentBlueprint_Identity_basic (0.48s)
    environment_blueprint_identity_gen_test.go:126: Terraform CLI version 1.9.8 is below minimum version 1.12.0: skipping test
--- SKIP: TestAccDataZoneEnvironmentBlueprint_Identity_regionOverride (0.11s)
--- PASS: TestAccDataZoneEnvironmentBlueprint_disappears (28.70s)
--- PASS: TestAccDataZoneEnvironmentBlueprint_basic (40.22s)
--- PASS: TestAccDataZoneEnvironmentBlueprint_userParameters (51.68s)
--- PASS: TestAccDataZoneEnvironmentBlueprint_update (53.96s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/datazone	54.225s

@mvincentbb
mvincentbb requested a review from a team as a code owner October 23, 2026 11:54
@github-actions

Copy link
Copy Markdown
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 馃殌

Voting for Prioritization

  • Please vote on this Pull Request by adding a 馃憤 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions Bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. sweeper Pertains to changes to or issues with the sweeper. generators Relates to code generators. service/datazone Issues and PRs that pertain to the datazone service. size/XL Managed by automation to categorize the size of a PR. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 23, 2026
Add a new Plugin Framework resource for DataZone custom environment
blueprints, supporting CloudFormation-provisioned blueprints with
user parameters.

- Create/Read/Update/Delete + import, exercised by acceptance tests
  (basic, update, disappears, userParameters) plus identity tests
- Retry AccessDenied on Create to absorb IAM propagation when DataZone
  reads the in-account S3 template as the domain execution role
- Bounded post-update read-after-write consistency wait, since
  UpdateEnvironmentBlueprint is eventually consistent on an immediate GET
- UseStateForUnknown on stable computed attributes to avoid a perpetual
  diff after in-place update
- Configurable timeouts { create } block driving the Create retry
- Fixtures model a V2 SMUS domain with the managed execution/service
  role policies and an in-account S3 CloudFormation template
Fixes providerlint AWSAT006 (avoid hardcoding AWS partition DNS
suffixes) by referencing the S3 bucket's bucket_regional_domain_name
attribute instead of a literal s3.amazonaws.com host in the environment
blueprint acceptance test template_url.
Resolve findings from pre-PR review of the new
aws_datazone_environment_blueprint resource:

- Delete/finder surface AccessDenied instead of silently dropping state
  (new isResourceNotFound, not-found only; shared isResourceMissing left
  untouched for the other datazone resources)
- description is Optional-only; Update sends empty string on removal
- Update sends an empty user_parameters list when the block is cleared
- Update gated on fwflex.Diff HasChanges (timeouts-only change skips API)
- register environment_blueprint sweeper as a domain-sweeper dependency
- partition-safe S3 template_url (bucket_regional_domain_name) in fixture
  and docs examples
- testAccPreCheck on all handwritten tests + @testing(preCheck) annotation
- document Timeouts and resource-identity import in website docs
- regenerate identity gen test and fixtures
DataZone returns AccessDeniedException (403) rather than
ResourceNotFoundException once the parent domain has been deleted, so
the shared isResourceMissing helper must keep treating it as absence.
Using a not-found-only check made CheckDestroy fail after domain
teardown. Revert to the package-wide helper used by every other
datazone resource.

Verified: all four TestAccDataZoneEnvironmentBlueprint acceptance
tests pass against a live account.
Semgrep rule ci.literal-default_value-string-constant flags the
literal "default_value" schema key.
UpdatedAt has one-second precision, so a stale read in the same
second passed the consistency wait and the refresh saw the old
description. Also require the description to match.
@mvincentbb
mvincentbb force-pushed the f-datazone-environment-blueprint branch from ecf3052 to 6718ac4 Compare October 23, 2026 13:33
@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Introduces or discusses updates to documentation. generators Relates to code generators. new-resource Introduces a new resource. service/datazone Issues and PRs that pertain to the datazone service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Resource]: aws_datazone_environment_blueprint

2 participants