Skip to content

Instantly share code, notes, and snippets.

@jsamuel1
Created February 13, 2019 03:05
Show Gist options
  • Save jsamuel1/83c722a9abc7c0d6b476908808a3c089 to your computer and use it in GitHub Desktop.
Save jsamuel1/83c722a9abc7c0d6b476908808a3c089 to your computer and use it in GitHub Desktop.
Terraform to enable long ARN formats for aws ecs, so that we can use fargate on all our workload accounts.
// Ensure we enroll ecs with long resource IDs
// Delete after April 1st as all new accounts will be enrolled by default
resource "null_resource" "enable_long_ecs_resource_ids" {
provisioner "local-exec" {
command = <<EOF
# $1=account_id, $2=region
source ${path.root}/../scripts/assume_role.sh \
${var.workload_account_id} \
${var.workload_provider_region}
# enable all ecs long IDs
aws ecs put-account-setting-default --name serviceLongArnFormat --value enabled
aws ecs put-account-setting-default --name taskLongArnFormat --value enabled
aws ecs put-account-setting-default --name containerInstanceLongArnFormat --value enabled
EOF
}
}
@rafilkmp3
Copy link

Still best way to do this hahahahahaha

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