Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Coalfire AWS KMS Terraform Module

License

NotificationsYou must be signed in to change notification settings

CiscoOpsStack/terraform-aws-kms-ops_stack

 
 

Repository files navigation

Coalfire

AWS KMS Terraform Module

Description

This module creates the necessary resources to store your Terraform code remotely in AWS.

FedRAMP Compliance: Moderate, High

Dependencies

  • IAM AWS Accounts
  • Any resources requiring KMS keys - IAM policy must be created upon key creation.

Resource List

Insert a high-level list of resources created as a part of this module. E.g.

  • KMS Key
  • KMS Key alias

Code Updates

Deployment Steps

This module can be called as outlined below.

  • Change directories to thekms directory.
  • From theterraform/aws/kms directory runterraform init.
  • Runterraform plan to review the resources being created.
  • If everything looks correct in the plan output, runterraform apply.

Usage

Include example for how to call the module below with generic variables

terraform {required_providers {aws={      source="hashicorp/aws"      version="=4.58"    }  }}#this can be called in region setupmodule"kms" {source="github.com/Coalfire-CF/ACE-AWS-KMS?ref=vX.X.X"resource_prefix=var.resource_prefixkms_key_resource_type="s3"key_policy=data.aws_iam_policy_document.s3_kms_policy.json}#this should be created where the module is called within the project. such as in region-setup or account setup if desired.data"aws_iam_policy_document""s3_kms_policy" {statement {sid="source-account-full-access"effect="Allow"actions=["kms:*"]resources=["*"]principals {type="AWS"identifiers=["arn:aws:iam::${var.mgmt_account_id}:root"]    }  }statement {sid="target-account-allow-grant"effect="Allow"# the following actions are required by Terraform to read/create/remove grantsactions=["kms:CreateGrant","kms:DescribeKey","kms:ListGrants","kms:RevokeGrant"    ]resources=["*"]# This allows any IAM role in the target account that has permission to create the grant to create the grant.# Can lock this down to a specific account in the target account so only that role is able to create grant for this keyprincipals {type="AWS"identifiers=["arn:aws:iam::${var.app_account_id}:root"]    }  }# Resource to be called where KMS access is required by a resource/service deploymentresource"aws_kms_grant""cross-account-grant" {name="grant-s3-kms-key"key_id=module.kms.arn# key above that was deployedgrantee_principal=data.aws_iam_role.my_role.arn#cross-account role or resource/service role you want to grant tooperations=["Encrypt","Decrypt","GenerateDataKey"]}        }

Requirements

NameVersion
terraform>= 1.5
aws>= 3.26

Providers

NameVersion
aws>= 3.26

Modules

No modules.

Resources

NameType
aws_kms_alias.kms_key_aliasresource
aws_kms_key.kms_keyresource

Inputs

NameDescriptionTypeDefaultRequired
key_descriptionThe description given to the created CMKstring""no
key_policyIAM key policy for the kms keyanynullno
kms_key_resource_typethe type of resource/service this key is for, such as S3, EBS or RDSstringn/ayes
resource_prefixThe prefix of the KMS key aliasstringn/ayes

Outputs

NameDescription
kms_key_arnThe arn of the s3 kms key
kms_key_idThe id of the s3 key

Contributing

Relative or absolute link to contributing.md

License

License

Coalfire Pages

Absolute link to any relevant Coalfire Pages

Copyright

Copyright © 2023 Coalfire Systems Inc.

About

Coalfire AWS KMS Terraform Module

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL100.0%

[8]ページ先頭

©2009-2025 Movatter.jp