-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convox run supports policies added to service #3743
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3743 +/- ##
==========================================
- Coverage 33.56% 33.14% -0.42%
==========================================
Files 180 182 +2
Lines 20253 20558 +305
==========================================
+ Hits 6797 6814 +17
- Misses 12309 12596 +287
- Partials 1147 1148 +1 ☔ View full report in Codecov by Sentry. |
This reverts commit d0c8f9a.
@@ -1191,10 +1192,38 @@ func (p *Provider) generateTaskDefinition2(app, service string, opts structs.Pro | |||
} | |||
} | |||
|
|||
td, err := p.stackResource(fmt.Sprintf("%s-%s", p.Rack, app), "ServiceWeb") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our cluster doesn't have service web
so it throw error ERROR: resource not found: ServiceWeb
when we do convox run [other service name]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@numcys can you fix this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khoinguyenm we have released the fix: https://github.com/convox/rack/releases/tag/20241104181809
Thanks for your patience
What is the feature/update/fix?
Feature: Support for Policies in
convox run
CommandThe
convox run
command now supports attaching IAM policies specified in yourconvox.yml
file. When executing a command inside a newly started ECS task container, any policies defined under thepolicies
key for a service will now be automatically attached to the container.How to use it?
You can define policies for a service in your
convox.yml
file. For example:With this configuration, running a command with
convox run
for theweb
service will start a new ECS task withmy-policy
attached, allowing the command to execute with the specified permissions.convox run
Command UsageThe
convox run
command can be used to execute one-off tasks, administrative scripts, or even interactive shells within the context of a Convox service. Some examples include:Running a simple command:
This will start a new container for the
web
service and list the files in the working directory.Starting an interactive shell:
This command spawns a bash shell in the container, allowing direct interaction.
Running a long-running task:
For tasks that may take longer than the default 1-hour timeout, you can set a custom timeout:
Detached Processes: For non-interactive tasks, use the
--detach
flag to run the command in the background without a timeout, with logs available in application logs:Why is this important?
This feature enhances the flexibility of
convox run
by enabling the use of custom IAM policies directly on the container running the command. This is particularly useful for tasks that need temporary access to AWS resources, like reading from S3 or accessing certain databases, without modifying the broader service configuration.Does it have a breaking change?
There are no breaking changes introduced with this feature.
Requirements
To use this feature, you must be on at least rack version
latest
.You can check your rack's version with the command
convox rack -r rackName
.Update your rack to the latest version with the command
convox rack update -r rackName
.