Created
September 14, 2023 18:18
-
-
Save amzar96/7c53f5368da1cf1765ec85f542249c94 to your computer and use it in GitHub Desktop.
Terraform - S3 Creation
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 { | |
cloud { | |
organization = "xxxx" | |
workspaces { | |
name = "s3-creation" | |
} | |
} | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 5.16.0" | |
} | |
} | |
required_version = ">= 1.1.0" | |
} | |
provider "aws" { | |
access_key = var.aws_access_key | |
secret_key = var.aws_secret_key | |
region = var.region | |
} | |
data "aws_iam_policy_document" "assume_role" { | |
statement { | |
effect = "Allow" | |
principals { | |
type = "Service" | |
identifiers = ["s3.amazonaws.com"] | |
} | |
actions = ["sts:AssumeRole"] | |
} | |
} | |
resource "aws_s3_bucket" "zar-tf" { | |
bucket = "zar-tf-bucket" | |
tags = { | |
Name = "Zars bucket" | |
Environment = "Dev" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment