Hey all, I’m new to Circle CI. Having trouble running a test with a basic AWS command and assume role.
I’ve gone through the AWS CLI orb documentation (which for some reason I’m not allowed to link in this post)
… but its not clear to me how assume role is meant to be used. The example that specified configure_role_arn doesn’t show a further example of how to actually run some other code with that assumed role.
I’ve tried running these two jobs, but the final command doesn’t actually use the assumed role from the step above, so I’m doing it wrong. Or am I supposed to run assume role for every single command?
File: config.yml
50: configure_role_arn:
51: executor: aws-cli/default
52: steps:
53: - checkout
54: - aws-cli/setup:
55: profile_name: default
56: - aws-cli/role_arn_setup:
57: profile_name: circle-ci
58: role_arn: arn:aws:iam::972620357255:role/circle-ci
59: source_profile: default
60: - run: >-
61: aws sts assume-role --role-arn
62: "arn:aws:iam::972620357255:role/circle-ci" --role-session-name
63: AWSCLI-Session
64:
65: test-lambda:
66: executor: aws-cli/default
67: steps:
68: - checkout
69: - aws-cli/setup:
70: profile_name: default
71: - aws-cli/role_arn_setup:
72: profile_name: circle-ci
73: role_arn: arn:aws:iam::972620357255:role/circle-ci
74: source_profile: default
75: - run: |
76: aws lambda invoke --function-name get_nebula_cert --payload '{"text":"Hello"}' response.txt --cli-binary-format raw-in-base64-out
77: cat response.txt