Skip to content

Instantly share code, notes, and snippets.

@brianonn
Created March 12, 2023 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianonn/62a47c216c2fde9bd7ad13ed52bea919 to your computer and use it in GitHub Desktop.
Save brianonn/62a47c216c2fde9bd7ad13ed52bea919 to your computer and use it in GitHub Desktop.
main.tf for use with localstack running on localhost port
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
required_version = "~> 1.0"
}
provider "aws" {
access_key = "test"
secret_key = "test"
region = "us-east-1"
s3_force_path_style = false
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
apigateway = "http://localhost:4566"
apigatewayv2 = "http://localhost:4566"
cloudformation = "http://localhost:4566"
cloudwatch = "http://localhost:4566"
dynamodb = "http://localhost:4566"
ec2 = "http://localhost:4566"
es = "http://localhost:4566"
elasticache = "http://localhost:4566"
firehose = "http://localhost:4566"
iam = "http://localhost:4566"
kinesis = "http://localhost:4566"
lambda = "http://localhost:4566"
rds = "http://localhost:4566"
redshift = "http://localhost:4566"
route53 = "http://localhost:4566"
s3 = "http://localhost:4566"
secretsmanager = "http://localhost:4566"
ses = "http://localhost:4566"
sns = "http://localhost:4566"
sqs = "http://localhost:4566"
ssm = "http://localhost:4566"
stepfunctions = "http://localhost:4566"
sts = "http://localhost:4566"
}
}
resource "aws_instance" "myserver" {
ami = "ami-830c94e3"
instance_type = "t3.micro"
count = 2
tags = {
Name = "Server 00${count.index + 1}",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment