Support creating AWS profiles for SES via aws-sign-in#6878
Open
dannyroberts wants to merge 5 commits into
Open
Support creating AWS profiles for SES via aws-sign-in#6878dannyroberts wants to merge 5 commits into
dannyroberts wants to merge 5 commits into
Conversation
bff2f5a to
7c38df8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SAAS-19727
Summary
The
manage-iam-keys.pyscript in #6872 needs an AWS profile set up the way commcare-cloud already sets up other ones — but pointing at the account where SES lives and with permissions to manage specific IAM user credentials. This is in service of scripting the SES SMTP credential rotation described in this runbook.This PR adds a
--sesflag tocchq <env> aws-sign-inthat reads new config from each env'saws.ymland writes out such a profile. The new<aws_profile>:sesprofiles live alongside the existing<aws_profile>:sessionused by terraform, and a developer doesn't need to know how either is set up.A couple of things worth flagging for review, since they don't show up in the diff:
iam_usernameis unused so far — added preemptively for one of the next tasks in https://dimagi.atlassian.net/browse/SAAS-19724, which will use it manage the SES IAM user during rotation.aws_sign_in_for_sesdeliberately skips the v1-credentials sync that the regular SSO flow does. That sync is a terraform compatibility shim; SES tooling uses modern AWS CLI / boto3, which read SSO natively.Environments Affected
production, staging, india, eu — all gain a new
ses_configblock inaws.yml. No services or hosts are touched; the field is read only by the newcchq <env> aws-sign-in --sesflow.Testing
cchq staging aws-sign-in --helpshows the new flagcchq staging aws-sign-in --sescommand creates a profile that works withmanage-iam-keys.py(clear withrm -rf ~/.aws/sso ~/.aws/clifirst)cchq staging aws-sign-inalso still works (clear withrm -rf ~/.aws/sso ~/.aws/clifirst)