Skip to content

Commit

Permalink
Add IAM user module
Browse files Browse the repository at this point in the history
  • Loading branch information
ranikamadurawe committed Mar 12, 2024
1 parent df1cf5b commit aa7a1da
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/aws/IAM-User/iam_user.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

resource "aws_iam_user" "iam_user" {
name = join("-", [var.project, var.application, var.environment, var.region, "iam-user"])
tags = var.tags
}
23 changes: 23 additions & 0 deletions modules/aws/IAM-User/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

output "iam_user_id" {
value = aws_iam_user.iam_user.id
depends_on = [aws_iam_user.iam_user]
}
output "iam_user_arn" {
value = aws_iam_user.iam_user.arn
depends_on = [aws_iam_user.iam_user]
}
output "iam_user_name" {
value = aws_iam_user.iam_user.name
depends_on = [aws_iam_user.iam_user]
}
32 changes: 32 additions & 0 deletions modules/aws/IAM-User/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

variable "project" {
type = string
description = "Name of the project"
}
variable "environment" {
type = string
description = "Name of the environment"
}
variable "region" {
type = string
description = "Code of the region"
}
variable "application" {
type = string
description = "Purpose of the ECR"
}
variable "tags" {
type = map(string)
description = "Tags to be associated with the EKS"
default = {}
}
20 changes: 20 additions & 0 deletions modules/aws/IAM-User/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -------------------------------------------------------------------------------------
#
# Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). All Rights Reserved.
#
# This software is the property of WSO2 LLC. and its suppliers, if any.
# Dissemination of any information or reproduction of any material contained
# herein in any form is strictly forbidden, unless permitted by WSO2 expressly.
# You may not alter or remove any copyright or other notice from copies of this content.
#
# --------------------------------------------------------------------------------------

terraform {
required_version = ">= 1.3.8"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}

0 comments on commit aa7a1da

Please sign in to comment.