Manual Installation - Terraform Configuration#

Create S3 Bucket for AWS Cloud#

Warning

Use only the AWS CLI for bucket creation. Do not create a bucket through the AWS Management Console.

  1. Use AWS CLI to create a new S3 bucket.

  2. Note the bucket name, region, and key.

Create a Directory and Set Up Terraform Configuration#

  1. In a terminal, navigate to the environment’s main directory.

  2. Create a new directory with the S3 bucket name:

    mkdir -p buckets/environments/<bucket_name>
    
  3. Copy the backend.tf and variable.tfvar files from the example directory into the new bucket directory:

    cp example-config/buckets/{backend.tf,variable.tfvar} buckets/environments/<bucket_name>
    

    The backend.tf file specifies where to store the Terraform state for this bucket deployment. Store the Terraform state with the backend.tf and variable.tfvar file here. See the following example:

    path="environments/<bucket_name>/terraform.tfstate"
    
  4. Edit the variable.tfvar file.

  5. Change the path, region and bucket to match the AWS S3 bucket settings. See the following example:

    variable.tfvar example#
    path="path_to_tfstate"
    region="us-west-2"
    bucket="<bucket_name>"
    
  6. Apply the Terraform configuration with the bucket name. This applies the configuration for the buckets module with the <bucket_name> from the backend.tf and variable.tfvar:

    make apply module=buckets env=<bucket_name>
    
  7. Type yes to complete the configuration.