Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kunduso
Created November 4, 2020 11:40
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 kunduso/91c4a8eb850e9ba9d4e63263f5e51511 to your computer and use it in GitHub Desktop.
Save kunduso/91c4a8eb850e9ba9d4e63263f5e51511 to your computer and use it in GitHub Desktop.
Main terraform file for AWS
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.13.0"
}
}
}
provider "aws" {
region = var.region
access_key = var.access_key
secret_key = var.secret_key
}
resource "random_integer" "rand_int" {
min = 10000
max = 99999
}
resource "aws_s3_bucket" "aws-b1" {
bucket = "${var.bucket_name}-${random_integer.rand_int.result}"
acl = "private"
tags = {
Name = "My bucket"
Environment = "Dev"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment