使用 Terraform 创建 IAM 资源
Redis 云 |
---|
您可以使用 HashiCorp Terraform 创建 Identity and Access Management (IAM) 资源,以支持 AWS 云账户对 Redis Cloud 订阅的访问。
以下示例使用terraform-aws-Redislabs-Cloud-Account-IAM-Resources
模块,位于 Amazon S3 中:
-
创建一个
main.tf
如下所示(更新profile
,region
和pgp_key
值)。请注意,
pgp_key
是必需的。有关详细信息,请参阅 Terraform 文档。 -
Initialize Terraform with the module:
Note: Terraform requires AWS credentials be supplied, but the source of the module is a public S3 bucket, so any valid credentials should work. Replace the
XXXX
fields below with your relevant valuesAWS_ACCESS_KEY_ID=XXXX AWS_SECRET_KEY=XXXX terraform init
-
Build the resources:
terraform apply
This displays the required values. To access the sensitive data:
-
accessSecretKey:
echo $(terraform output -raw accessSecretKey)
-
consolePassword:
echo $(terraform output -raw consolePassword | base64 --decode | keybase pgp decrypt)
-