Create IAM resources using Terraform

Redis Cloud

You can use HashiCorp Terraform to create identity and access management (IAM) resources to support AWS cloud account access to Redis Cloud subscriptions.

Warning:

We use the provided credentials to configure your AWS environment and provision required resources.

You must not change the configurations of provisioned resources or stop or terminate provisioned instances. If you do, your databases will be inaccessible and Redis will not be able to ensure database stability. See Avoid service disruption for more details.

The following example uses the terraform-aws-Redislabs-Cloud-Account-IAM-Resources module, located in Amazon S3:

  1. Copy the following code into a file called main.tf.

    View main.tf

    Replace the following values in the main.tf file:

    • <profile>: The AWS CLI profile to use.
    • <region>: The AWS region to use.
    • <pgp_key>: The PGP key to use. For details, see the Terraform docs.
  2. 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.

    AWS_ACCESS_KEY_ID=<access_key_id> AWS_SECRET_KEY=<secret_key> terraform init
    

    Replace <access_key_id> and <secret_key> with valid AWS keys.

  3. Build the resources and display the outputs:

    terraform apply
    

    You need the following information to create a Cloud Account in the Redis Cloud console:

    • Access Key ID: The accessKeyId output.
    • Secret Access Key: Run the following command to extract the secret key from the accessSecretKey output:
      echo $(terraform output -raw accessSecretKey)
      
    • IAM Role Name: The IAMRoleName output.
RATE THIS PAGE
Back to top ↑