Skip to content

aws_mwaaserverless_workflow: Add code argument - #49929

Draft
astanfel wants to merge 7 commits into
hashicorp:mainfrom
astanfel:f-mwaaserverless-workflow-code
Draft

aws_mwaaserverless_workflow: Add code argument#49929
astanfel wants to merge 7 commits into
hashicorp:mainfrom
astanfel:f-mwaaserverless-workflow-code

Conversation

@astanfel

@astanfel astanfel commented Sep 9, 2026

Copy link
Copy Markdown

Description

Follow-up to #49927. Adds the optional code argument to aws_mwaaserverless_workflow, which was deliberately deferred from the initial resource PR because it maps to a Smithy tagged union (types.Code / CodeMemberS3Location).

code is modeled as a nested block containing an s3_location block (the sole current union member), using the provider's standard union pattern — a flex.Expander/flex.Flattener implemented on codeModel. It is wired into the update path (the UpdateWorkflow API accepts Code, so it is updatable in place) and covered by a new acceptance test (TestAccMWAAServerlessWorkflow_code) and documentation.

resource "aws_mwaaserverless_workflow" "example" {
  name     = "example"
  role_arn = aws_iam_role.example.arn

  definition_s3_location {
    bucket     = aws_s3_bucket.example.id
    object_key = aws_s3_object.definition.key
  }

  code {
    s3_location {
      bucket     = aws_s3_bucket.example.id
      object_key = aws_s3_object.code.key
    }
  }
}

⚠️ Stacked on #49927

This branch is stacked on the branch for #49927 (which introduces the resource itself). Until #49927 merges, the diff below includes those commits. Once #49927 is merged, this branch will be rebased onto main and the diff will reduce to just the code support. Opening as a draft for early visibility; it should be reviewed after #49927.

Relations

Relates to #45254
Depends on #49927

Output from Acceptance Testing

Acceptance tests require a live account with MWAA Serverless access and are not run in this environment. The package builds, vets, and links cleanly.

$ make testacc TESTS=TestAccMWAAServerlessWorkflow_code PKG=mwaaserverless
# (pending run against an account with MWAA Serverless enabled)

Adds the aws_mwaaserverless_workflow resource for Amazon MWAA Serverless,
covering create/read/update/delete, transparent tagging, ARN-based resource
identity, and acceptance/identity/tags tests.

Closes hashicorp#45254
Adds the optional code block (Smithy union types.Code / CodeMemberS3Location)
via a flex.Expander/Flattener on codeModel, wires it into the update path, and
adds acceptance test + documentation coverage.
@github-actions

github-actions Bot commented Sep 9, 2026

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. generators Relates to code generators. service/mwaaserverless Issues and PRs that pertain to the mwaaserverless service. size/XL Managed by automation to categorize the size of a PR. labels Sep 9, 2026
MWAA Serverless workflows are created/updated synchronously (no CREATING
state, no API waiter), so reduce create/update timeouts (30m was carried
over from MWAA environments) and document the synchronous behavior. Also
correct the documented workflow ARN format to workflow/<name>-<suffix>.
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. needs-triage Waiting for first response or review from a maintainer. service/mwaaserverless Issues and PRs that pertain to the mwaaserverless service. size/XL Managed by automation to categorize the size of a PR. 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.

1 participant