base-module

AntonAleksandrov13/base-module/aws

Terraform Module HCL AWS

This repository contains base configurations for running terraform in AWS. It provisions base IAM user/role with minimum required policies, S3 bucket for state storage and Dynamodb for locking

Install
module "base-module" {
source = "AntonAleksandrov13/base-module/aws"
version = "1.0.0"
}
plain text: /constructs/tfmod-antonaleksandrov13-base-module-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

terraform-aws-base-module This repository contains a set of AWS resources required for state storing and locking. Using this module, you can create all necessary resources to get started with remote state in AWS S3. What does it deploy? This module deploys: 1. AWS IAM role 2. AWS IAM policy for S3 access based on Terraform documentation 3. AWS IAM policy for DynamoDB access based on Terraform documentation 4. S3 bucket for remote state storage 5. DynamoDB table for state locking Implementation Run this module first to create all necessary resources for working with AWS and then proceed with your infrastructure. ``terraform variable "region" { default = "eu-central-1" } provider "aws" { region = var.region } terraform { required_providers { aws = ">= 3.22.0" } } module "base-module" { sourc

Inputs (10)
NameTypeDescriptionDefault
user_namestringAWS IAM user name which can assume role. Does nothing without allow_user_assume_"some_user_name"
allow_user_assume_on_roleboolAllows to an AWS IAM user to assume the newly created IAM role. See user_name vafalse
additional_policies_arnlist(string)List of AWS IAM policy arns that will be attached to the newly created IAM role.[]
create_base_roleboolBoolean determines whether to create a new IAM role. Note: only S3 and DynamoDB false
role_namestringThe name of a new IAM role."terraform"
generate_bucket_nameboolBoolean determines whether to generate S3 bucket name. If enabled, S3 bucket wiltrue
state_bucket_name_overridestringOverrides the generated S3 bucket name"my-very-unique-terraform-state-eu-centr
s3_state_key_pathstringS3 prefix used in IAM policy for S3 access. Determines which prefix can be read "/*"
generate_lock_table_nameboolBoolean determines whether to generate DynamoDB table name. If enabled, the tabltrue
lock_table_name_overridestringOverrides the generated DynamoDB table name."terraform-state-lock"
Outputs (4)
role_name
role_arn
s3_bucket_name
lock_table_name
Resources (6)
aws_dynamodb_tableaws_iam_policyaws_iam_roleaws_iam_role_policy_attachmentaws_s3_bucketaws_s3_bucket_public_access_block
Details
FrameworkTerraform Module
LanguageHCL
Version1.0.0
Cloud AWS
★ Stars1
Forks2
Total downloads4.8k
Inputs10
Outputs4
Resources6
Examples3
LicenseApache-2.0
NamespaceAntonAleksandrov13
Updated