mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-13 01:00:50 -04:00
2.1 KiB
2.1 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| aws | AWS: aws_iam_access_key | docs-aws-resource-iam-access-key | Provides an IAM access key. This is a set of credentials that allow API requests to be made as an IAM user. |
aws_iam_access_key
Provides an IAM access key. This is a set of credentials that allow API requests to be made as an IAM user.
Example Usage
resource "aws_iam_access_key" "lb" {
user = "${aws_iam_user.lb.name}"
pgp_key = "keybase:some_person_that_exists"
}
resource "aws_iam_user" "lb" {
name = "loadbalancer"
path = "/system/"
}
resource "aws_iam_user_policy" "lb_ro" {
name = "test"
user = "${aws_iam_user.lb.name}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:Describe*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
EOF
}
output "secret" {
value = "${aws_iam_access_key.lb.encrypted_secret}"
}
Argument Reference
The following arguments are supported:
user- (Required) The IAM user to associate with this access key.pgp_key- (Optional) Either a base-64 encoded PGP public key, or a keybase username in the formkeybase:username.
Attributes Reference
The following attributes are exported:
id- The access key ID.user- The IAM user associated with this access key.key_fingerprint- The fingerprint of the PGP key used to encrypt the secretsecret- The secret access key. Note that this will be written to the state file. Please supply apgp_keyinstead, which will prevent the secret from being stored in plain textencrypted_secret- The encrypted secret, base64 encoded. ~> NOTE: The encrypted secret may be decrypted using the command line, for example:terraform output secret | base64 --decode | keybase pgp decrypt.ses_smtp_password- The secret access key converted into an SES SMTP password by applying AWS's documented conversion algorithm.status- "Active" or "Inactive". Keys are initially active, but can be made inactive by other means.