Snippets for yer computer needs


Create a user

aws iam create-user --user-name <user>

Create an access key

aws iam create-access-key --user-name <user>

Attaching IAM roles to an instance

aws ec2 associate-iam-instance-profile --instance-id YourInstanceId --iam-instance-profile Name=YourNewRole-Instance-Profile

Signing Certificates

aws iam upload-signing-certificate --user-name user-name --certificate-body file://path/to/certificate.pem
aws iam list-signing-certificates --user-name user-name

Server certificates

# get cert names
aws iam list-server-certificates
# get cert details
aws iam get-server-certificate --server-certificate-name NAME
# upload cert
aws iam upload-server-certificate --server-certificate-name NAME --certificate-body file://public_key_cert_file.pem --private-key file://my_private_key.pem --certificate-chain file://my_certificate_chain_file.pem
# delete a cert
aws iam delete-server-certificate --server-certificate-name NAME

Resource-level permissions

Some permissions can’t be narrowed to something like a tag. This is an easy trip-up when you’re dealing policy creation, as they’ll need to be slightly different statements.