This project creates an AWS S3 bucket to store the deployment artifacts for any AWS Lambdas that will be used in a CyHy environment.
- Terraform installed on your system.
- AWS CLI access configured for the appropriate account on your system.
- An accessible AWS S3 bucket to store Terraform state
(specified in
backend.tf
). - An accessible AWS DynamoDB database to store the Terraform state lock
(specified in
backend.tf
).
Create a Terraform variables file to be used for your environment (e.g.
production.tfvars
), based on the variables listed in Inputs
below. Here is a sample of what that file might look like:
aws_region = "us-east-2"
tags = {
Team = "CISA Development Team"
Application = "Cyber Hygiene Lambda Artifacts"
Workspace = "production"
}
-
Create a Terraform workspace (if you haven't already done so) by running:
terraform workspace new <workspace_name>`
-
Create a
<workspace_name>.tfvars
file with all of the required variables and any optional variables desired (see Inputs below for details). -
Run the command
terraform init
. -
Create the Terraform infrastructure by running the command:
terraform apply -var-file=<workspace_name>.tfvars
- Select the appropriate Terraform workspace by running
terraform workspace select <workspace_name>
. - Destroy the Terraform infrastructure in that workspace by running
terraform destroy -var-file=<workspace_name>.tfvars
.
Name | Version |
---|---|
terraform | ~> 1.1 |
aws | ~> 4.9 |
Name | Version |
---|---|
aws | ~> 4.9 |
No modules.
Name | Type |
---|---|
aws_s3_bucket.lambda_artifacts | resource |
aws_s3_bucket_ownership_controls.lambda_artifacts | resource |
aws_s3_bucket_public_access_block.lambda_artifacts | resource |
aws_s3_bucket_server_side_encryption_configuration.lambda_artifacts | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
aws_region | The AWS region to deploy into (e.g. us-east-1). | string |
"us-east-1" |
no |
lambda_artifacts_s3_bucket | The name of the bucket where any Lambda deployment artifacts for a CyHy environment will be stored. Note that in production Terraform workspaces, the string '-production' will be appended to the bucket name. In non-production workspaces, '-<workspace_name>' will be appended to the bucket name. | string |
"cyhy-lambda-deployment-artifacts" |
no |
tags | Tags to apply to all AWS resources created. | map(string) |
{} |
no |
No outputs.
Running pre-commit
requires running terraform init
in every directory that
contains Terraform code. In this repository, this is only the main directory.
We welcome contributions! Please see CONTRIBUTING.md
for
details.
This project is in the worldwide public domain.
This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.