Creating IAM user with access key
See original GitHub issueI’m trying to create a user with an access key along the following lines:
import iam = require('@aws-cdk/aws-iam')
const myUserName = 'my-user-name'
const user = new iam.User(this, 'myUser', {
userName: userName
})
const accessKey = new iam.CfnAccessKey(this, 'myAccessKey', {
userName: myUserName
})
new cdk.Output(this, 'accessKeyId', { value: accessKey.accessKeyId });
new cdk.Output(this, 'secretAccessKey', { value: accessKey.accessKeySecretAccessKey });
This works OK when I run it in two stages so that the user gets created in the first deployment and the access key gets created in the second deployment. However, if it’s run in a single stage it looks like the creation of the access key does not wait for the user to be created and thus an error occurs.
Is there a way to express the dependency of the access key resource on the user resource?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:10 (7 by maintainers)
Top Results From Across the Web
create-access-key — AWS CLI 1.27.37 Command Reference
Creates a new Amazon Web Services secret access key and corresponding Amazon Web Services access key ID for the specified user. The default...
Read more >create-access-key — AWS CLI 2.9.8 Command Reference
Creates a new Amazon Web Services secret access key and corresponding Amazon Web Services access key ID for the specified user. The default...
Read more >How to create IAM User Access Keys via AWS CLI
To create programmatic Access Keys for an AWS IAM User using AWS CLI, run the command aws iam create-access-key . On the command...
Read more >Step-by-step guide on how to create an IAM user in AWS
Select the Users menu. Navigate to the Users screen. You'll find it in the IAM dashboard, under the Identity and Access Management (IAM)...
Read more >AWS Access Key IAM Permissions and IAM Policies
Create IAM user for FortiSIEM monitoring · Login to the IAM Console - Users Tab. · Click Create Users. · Type in a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The syntax mentioned above (
cdk.Output
) is out of date. To achieve the same thing now you would use:Hey @floehopper,
can you try:
?
Thanks, Adam