Skip to content

Terraform module for opening a support case when a new account is added (useful for adding new accounts to enterprise support)

License

Notifications You must be signed in to change notification settings

deanp3it/terraform-aws-org-new-account-support-case

 
 

Repository files navigation

terraform-aws-org-new-account-support-case

A Terraform module to enable Enterprise support on a new account.

This module uses CloudWatch Events to identify when new accounts are added or invited to an AWS Organization, and triggers a Lambda function to create the new account.

Testing

To set up and run tests:

# Ensure the dependencies are installed on your system.
make python/deps
make pytest/deps

# Start up a mock AWS stack:
make mockstack/up

# Run unit tests:
make docker/run target=pytest/lambda/tests

# Run the tests:
make mockstack/pytest/lambda

# Shut down the mock AWS stack and clean up docker images:
make mockstack/clean

Requirements

Name Version
terraform >= 0.13.1
aws >= 4.9
external >= 1.0
local >= 1.0
null >= 2.0

Providers

Name Version
aws >= 4.9
random n/a

Resources

Name Type
aws_iam_policy_document.lambda data source
aws_partition.current data source

Inputs

Name Description Type Default Required
cc_list Comma-separated list of email addresses to CC on this case. At least one email address is required. string n/a yes
communication_body Text for body of the communication sent to support. The variable 'account_id' can be used within the text if preceded by a dollar sign and optionally enclosed by curly braces. string n/a yes
subject Text for 'Subject' field of the communication sent to support. The variable 'account_id' can be used within the text if preceded by a dollar sign and optionally enclosed by curly braces. string n/a yes
event_types Event types that will trigger this lambda set(string)
[
"CreateAccountResult",
"InviteAccountToOrganization"
]
no
lambda Map of any additional arguments for the upstream lambda module. See https://github.com/terraform-aws-modules/terraform-aws-lambda any {} no
log_level Log level of the lambda output, one of: debug, info, warning, error, critical string "info" no
tags Tags that are passed to resources map(string) {} no

Outputs

Name Description
aws_cloudwatch_event_rule The cloudwatch event rule object
aws_cloudwatch_event_target The cloudWatch event target object
aws_lambda_permission_events The lambda permission object for cloudwatch event triggers
lambda The lambda module object

About

Terraform module for opening a support case when a new account is added (useful for adding new accounts to enterprise support)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 73.3%
  • HCL 21.9%
  • Makefile 3.1%
  • Dockerfile 1.3%
  • Shell 0.4%