Skip to content

Commit eac60f5

Browse files
authored
Merge pull request #10 from StackGuardian/aws-static
added-aws-static
2 parents 75afe6a + e98804a commit eac60f5

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

Diff for: aws_static/main.tf

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
resource "aws_iam_user" "new-user" {
2+
name = var.iam_user # Change the user name as needed
3+
}
4+
5+
resource "aws_iam_access_key" "my_access_key" {
6+
user = aws_iam_user.new-user.name
7+
}
8+
9+
output "access_key_id" {
10+
value = aws_iam_access_key.my_access_key.id
11+
}
12+
13+
output "secret_access_key" {
14+
value = aws_iam_access_key.my_access_key.secret
15+
sensitive = true # This will hide the secret in Terraform outputs
16+
}

Diff for: aws_static/provider.tf

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
version = "5.72.1"
6+
}
7+
}
8+
}
9+
10+
provider "aws" {
11+
region = var.aws_region
12+
}

Diff for: aws_static/variables.tf

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
variable "aws_region" {
2+
type = string
3+
default = "eu-central-1"
4+
description = "AWS region"
5+
}
6+
7+
variable "iam_user" {
8+
type = string
9+
default = "example"
10+
description = "name of the iam user created"
11+
}

0 commit comments

Comments
 (0)