From 8611caa3be884c904a67da11560b3afb63dcd4e8 Mon Sep 17 00:00:00 2001 From: Eunsoo Shin Date: Tue, 10 Sep 2024 01:04:25 -0400 Subject: [PATCH] add s3 example --- terraform/aws.tf | 18 ++++++++++++++++++ terraform/modules/aws_account/README.md | 0 terraform/modules/aws_account/main.tf | 6 ++++++ terraform/modules/aws_account/output.tf | 0 terraform/modules/aws_account/variables.tf | 9 +++++++++ terraform/provider.tf | 6 +++--- 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 terraform/aws.tf create mode 100644 terraform/modules/aws_account/README.md create mode 100644 terraform/modules/aws_account/main.tf create mode 100644 terraform/modules/aws_account/output.tf create mode 100644 terraform/modules/aws_account/variables.tf diff --git a/terraform/aws.tf b/terraform/aws.tf new file mode 100644 index 0000000..e2cc3e7 --- /dev/null +++ b/terraform/aws.tf @@ -0,0 +1,18 @@ +# module "s3_bucket" { +# source = "terraform-aws-modules/s3-bucket/aws" + +# bucket = "cis1912-test" +# acl = "private" + +# control_object_ownership = true +# object_ownership = "ObjectWriter" +# } + +resource "aws_s3_bucket" "example" { + bucket = "cis1912-test-bucket" + + tags = { + Name = "CIS 1912 Test Bucket" + Environment = "Dev" + } +} diff --git a/terraform/modules/aws_account/README.md b/terraform/modules/aws_account/README.md new file mode 100644 index 0000000..e69de29 diff --git a/terraform/modules/aws_account/main.tf b/terraform/modules/aws_account/main.tf new file mode 100644 index 0000000..01766c9 --- /dev/null +++ b/terraform/modules/aws_account/main.tf @@ -0,0 +1,6 @@ +resource "aws_iam_user" "user" { + name = var.pennkey + tags = { + created-by = "terraform" + } +} diff --git a/terraform/modules/aws_account/output.tf b/terraform/modules/aws_account/output.tf new file mode 100644 index 0000000..e69de29 diff --git a/terraform/modules/aws_account/variables.tf b/terraform/modules/aws_account/variables.tf new file mode 100644 index 0000000..094d696 --- /dev/null +++ b/terraform/modules/aws_account/variables.tf @@ -0,0 +1,9 @@ +variable "pennkey" { + type = string + description = "Pennkey of student" +} + +variable "emails" { + type = map(any) + description = "Pennkey to email map" +} diff --git a/terraform/provider.tf b/terraform/provider.tf index ffe19da..12dc8ff 100644 --- a/terraform/provider.tf +++ b/terraform/provider.tf @@ -1,6 +1,6 @@ -# provider "aws" { -# region = "us-east-1" -# } +provider "aws" { + region = "us-east-1" +} # provider "helm" { # kubernetes {