Prerequisites
- Terraform 1.1 or later, or any OpenTofu release
- AWS provider 5.67.0 or later. The StackSet option depends on the
aws_cloudformation_stack_instancesresource added in that version - AWS credentials with permission to create IAM roles and policies in the target account
- The External ID from the Draftt setup dialog (Integrations > AWS)
Setup methods
Single Account
Single Account
Download the read-only policy
Declare the trust policy
draftt-fetcher role in Draftt’s AWS account can assume the role, and only with your External ID:Create the role
Attach the AWS managed policies
Attach DrafttReadOnlyPolicy
Declare inputs and outputs
Plan and apply
Enter the Role ARN in Draftt
draftt_role_arn output into the Role ARN field in the Draftt setup dialog and click Create.CloudFormation Stack
CloudFormation Stack
Create the stack
Declare inputs and outputs
Plan and apply
Enter the Role ARN in Draftt
draftt_role_arn output into the Role ARN field in the Draftt setup dialog and click Create.ExternalID stack output, so it is visible to anyone with cloudformation:DescribeStacks in the account. The stack outputs are also stored in Terraform state.CloudFormation StackSet (Multi Account)
CloudFormation StackSet (Multi Account)
Declare the trust policy
Create the organization-level role
Attach the AWS managed policies
Create the StackSet
Deploy the stack instances
Declare inputs and outputs
Plan and apply
SUCCEEDED under the StackSet’s stack instances before continuing. Draftt waits up to 30 minutes for the rollout and only connects accounts that succeeded.Enter the ARNs in Draftt
draftt_organization_role_arn output into the organization Role ARN field, and the draftt_stack_set_arn output into the StackSet ARN field in the Draftt setup dialog.Notes
sensitive, Terraform hides the whole rendered trust policy in plan output. To review the trust policy after apply, run aws iam get-role --role-name DrafttAccess-Role. The External ID is still stored in Terraform state, so protect your state file as you would any other secret.