Skip to content

Commit 65383ed

Browse files
chore: disable --use-task-role by default (#5602)
Removes a planned breaking change. Decision is to release the feature to be off by default to assess where users have issues with the flag as it can be set to enabled by default in the future. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
1 parent 638ec44 commit 65383ed

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

internal/pkg/cli/errors.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,16 @@ func (e *errTaskRoleRetrievalFailed) Error() string {
173173
}
174174

175175
func (e *errTaskRoleRetrievalFailed) RecommendActions() string {
176-
return fmt.Sprintf(`TaskRole retrieval failed. If your containers don't require the TaskRole for local testing, you can use %s to disable this feature.
177-
If you require the TaskRole, you can manually add permissions for your account to assume TaskRole by adding the following YAML override to your service:
176+
return fmt.Sprintf(`TaskRole retrieval failed. If you require the TaskRole, you can try these methods to enable it:
177+
1. Enable exec in the service manifest:
178178
%s
179-
For more information on YAML overrides see %s`,
180-
color.HighlightCode(`copilot run local --use-task-role=false`),
179+
180+
2. Add permissions for your account to assume TaskRole by adding the following YAML override to your service:
181+
%s
182+
183+
For more information on YAML overrides see %s
184+
`,
185+
color.HighlightCodeBlock(`exec: true # Enable running commands in your container.`),
181186
color.HighlightCodeBlock(`- op: add
182187
path: /Resources/TaskRole/Properties/AssumeRolePolicyDocument/Statement/-
183188
value:

internal/pkg/cli/run_local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ func BuildRunLocalCmd() *cobra.Command {
12431243
cmd.Flags().StringVarP(&vars.envName, envFlag, envFlagShort, "", envFlagDescription)
12441244
cmd.Flags().StringVarP(&vars.appName, appFlag, appFlagShort, tryReadingAppName(), appFlagDescription)
12451245
cmd.Flags().BoolVar(&vars.watch, watchFlag, false, watchFlagDescription)
1246-
cmd.Flags().BoolVar(&vars.useTaskRole, useTaskRoleFlag, true, useTaskRoleFlagDescription)
1246+
cmd.Flags().BoolVar(&vars.useTaskRole, useTaskRoleFlag, false, useTaskRoleFlagDescription)
12471247
cmd.Flags().Var(&vars.portOverrides, portOverrideFlag, portOverridesFlagDescription)
12481248
cmd.Flags().StringToStringVar(&vars.envOverrides, envVarOverrideFlag, nil, envVarOverrideFlagDescription)
12491249
cmd.Flags().BoolVar(&vars.proxy, proxyFlag, false, proxyFlagDescription)

site/content/blogs/release-v133.en.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ Copilot v1.33 brings big enhancements to help you develop more flexibly and effi
3333

3434
## Use ECS Task Role for `copilot run local`
3535

36-
`copilot run local` now has a flag `--use-task-role` which is enabled by default. When enabled, Copilot will retrieve the IAM permissions from your deployed service and inject them into the containers created by `run local`.
36+
`copilot run local` now has a flag `--use-task-role`. When enabled, Copilot will retrieve the IAM permissions from your deployed service and inject them into the containers created by `run local`.
3737
This means that your containers will have the same permissions that they do on the cloud, enabling you to test more accurately.
3838

39-
If you don't want to use the `TaskRole` permissions, or if Copilot fails to retrieve them, you can disable this feature by setting `--use-task-role=false`.
40-
4139
## Container dependencies support for `copilot run local`
4240

4341
`copilot run local` now respects the [`depends_on`](../docs/manifest/lb-web-service.md#image-depends-on) specified in the service manifest.

0 commit comments

Comments
 (0)