Last active
March 29, 2020 20:16
-
-
Save vinicius73/5e9dd58ae3385fd19087ffa8ad3ee575 to your computer and use it in GitHub Desktop.
Terraform + Digital Ocean Spaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init: | |
@read -p "SPACES_ACCESS_TOKEN=" SPACES_ACCESS_TOKEN; \ | |
read -p "SPACES_SECRET_KEY=" SPACES_SECRET_KEY; \ | |
read -e -p "SPACE_BUCKET_NAME=" -i "space-name" SPACE_BUCKET_NAME; \ | |
terraform init \ | |
-backend-config="access_key=$$SPACES_ACCESS_TOKEN" \ | |
-backend-config="secret_key=$$SPACES_SECRET_KEY" \ | |
-backend-config="bucket=$$SPACE_BUCKET_NAME" | |
plan: | |
- terraform plan | |
apply: | |
- terraform apply |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_version = ">= 0.12.21" | |
backend "s3" { | |
endpoint = "nyc3.digitaloceanspaces.com" | |
key = "v2/terraform.tfstate" | |
bucket = "space-name" | |
region = "us-west-1" | |
skip_credentials_validation = true | |
skip_metadata_api_check = true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment