使用 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
XXXXfields below with your relevant valuesAWS_ACCESS_KEY_ID=XXXX AWS_SECRET_KEY=XXXX terraform init -
Build the resources:
terraform applyThis 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)
-