-
Notifications
You must be signed in to change notification settings - Fork 7
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
Follow on issue from configure-aws-credentials #2
Comments
I checked AWS Documentation and I can see that it does not list Parameter Name Limitations"Only a mix of letters, numbers and the following 3 symbols .-_ are allowed" in parameter names according to the AWS Console. So if your claim PolicyMake sure you use {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "ssm:PutParameter",
"Resource": "arn:aws:ssm:eu-west-1:111111111111:parameter/1-${aws:principalTag/environment}/myservice"
}
]
} Usage in GitHub ActionsAssigning the policy above to the AWS IAM Role you use with Cognito Identity should allow you to test a workflow like below that it works. name: SSM Test
on:
workflow_dispatch:
inputs:
environment:
type: string
required: true
description: Environment
jobs:
test:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
permissions:
id-token: write
contents: read
steps:
- uses: catnekaise/cognito-idpool-auth@alpha
with:
cognito-identity-pool-id: "eu-west-1:11111111-example"
aws-account-id: "111111111111"
aws-region: "eu-west-1"
audience: "cognito-identity.amazonaws.com"
set-in-environment: true
- name: Create Parameter
run: |
aws ssm put-parameter --name /1-${{ inputs.environment }}/myservice \
--value my_value --type String --overwrite |
btw it looks like I found a bug https://github.com/catnekaise/cognito-idpool-auth/blob/alpha/action.yml#L170 |
@1oglop1 you are right. Thanks for noticing this. Will update both this action and the basic-auth action as they most have the same regex validation. Did you manage to solve the permission issue you described in the beginning? |
This is a follow-up on aws-actions/configure-aws-credentials#419 (comment)
Hello @djonser,
I managed to set everything up and tested both actions. They work as expected.
Limitations I ran into with this setup:
${aws:principalTag/<value>}
in theResource: "arn:aws:ssm:eu-central-1:1234567890:parameter/1-${aws:requestTag/workflow}/myservice
As a consequence of this limitation, I wasn't able to map any claim from the GitHub token to the resource which do not support Tags or access by a tag.
In my case we have a mono-repo with multiple services. And each service has 3 deploy workflows, one for each environment.
Then workflow names have these combinations.
And github environment is set to one of
dev, int, prod
.So I could not use the
repository
claim either, because it maps to multiple services.However, some resources have a service name as part of the name eg:
target-group-svc1
and none of the claims can map directly to thesvc1
.As a workaround, I thought of using an
audience
claim, but there is AWS Limit of 100 audiences per IAM OIDC provider.Thank you for your blog post and provided idea for implementation.
PS. this is not really an issue, feel free to close it.
The text was updated successfully, but these errors were encountered: