Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Last active August 14, 2021 19:08
Show Gist options
  • Save diegopacheco/6c2fe827444d4f3a350ba1f477a7d1e4 to your computer and use it in GitHub Desktop.
Save diegopacheco/6c2fe827444d4f3a350ba1f477a7d1e4 to your computer and use it in GitHub Desktop.
Terraform + Localstack
provider "aws" {
region = "us-west-2"
access_key = "anaccesskey"
secret_key = "asecretkey"
skip_credentials_validation = true
skip_metadata_api_check = true
s3_force_path_style = true
endpoints {
s3 = "http://119.18.0.101:4572"
}
}
resource "aws_s3_bucket" "b" {
bucket = "my-tf-test-bucket"
acl = "public-read"
}
output "address" {
value = "${aws_s3_bucket.b.bucket}"
}
variable "aws_region" {
description = "AWS region to launch servers."
default = "us-west-2"
}
variable "key_name" {
description = "Name of the SSH keypair to use in AWS."
default = "deployer-ley"
}
variable "key_path" {
description = "Path to the private portion of the SSH key specified."
default = "~/pem.pem"
}
@aissarmurad
Copy link

Why I should set up s3 endpoint to 119.18.0.101 in main.tf line 9?
It's not a reserved ip address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment