Skip to content

Commit 1b6c58c

Browse files
Merge branch 'main' into dependabotCombined
2 parents d9bcecf + 344a038 commit 1b6c58c

44 files changed

Lines changed: 384 additions & 178 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/tfsec/action.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/actions/trivy/action.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Trivy Scan"
2+
runs:
3+
using: "composite"
4+
steps:
5+
- name: "Trivy Terraform IAC Scan"
6+
shell: bash
7+
run: |
8+
modules_exit_code=0
9+
10+
./scripts/terraform/trivy.sh ./infrastructure/modules || modules_exit_code=$?
11+
12+
if [ $components_exit_code -ne 0 ] || [ $modules_exit_code -ne 0 ]; then
13+
echo "Trivy misconfigurations detected."
14+
exit 1
15+
fi

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ jobs:
4040
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
4141
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
4242
echo "build_epoch=$(date --date=$datetime -u +'%s')" >> $GITHUB_OUTPUT
43-
echo "nodejs_version=$(grep "^nodejs " .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
44-
echo "python_version=$(grep "^python " .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
45-
echo "terraform_version=$(grep "^terraform " .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
43+
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
44+
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
45+
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
4646
echo "version=$(echo $version)" >> $GITHUB_OUTPUT
4747
echo "is_version_prerelease=$(if [[ $version == *-* ]]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT
4848

.github/workflows/cicd-3-deploy.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
4646
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
4747
echo "build_epoch=$(date --date=$datetime -u +'%s')" >> $GITHUB_OUTPUT
48-
echo "nodejs_version=$(grep "^nodejs " .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
49-
echo "python_version=$(grep "^python " .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
50-
echo "terraform_version=$(grep "^terraform " .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
48+
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
49+
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
50+
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
5151
# TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
5252
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
5353
# echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT

.github/workflows/stage-1-commit.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ jobs:
135135
uses: actions/checkout@v4
136136
- name: "Lint Terraform"
137137
uses: ./.github/actions/lint-terraform
138-
tfsec:
139-
name: "TFSec Scan"
138+
trivy:
139+
name: "Trivy Scan"
140140
runs-on: ubuntu-latest
141141
timeout-minutes: 5
142142
needs: detect-terraform-changes
@@ -148,8 +148,8 @@ jobs:
148148
uses: asdf-vm/actions/setup@v3
149149
- name: "Perform Setup"
150150
uses: ./.github/actions/setup
151-
- name: "TFSec Scan"
152-
uses: ./.github/actions/tfsec
151+
- name: "Trivy Scan"
152+
uses: ./.github/actions/trivy
153153
count-lines-of-code:
154154
name: "Count lines of code"
155155
runs-on: ubuntu-latest

.tool-versions

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This file is for you! Please, updated to the versions agreed by your team.
22

3+
gitleaks 8.18.4
4+
nodejs 18.18.2
5+
pre-commit 3.6.0
36
terraform 1.9.2
47
terraform-docs 0.19.0
5-
pre-commit 3.6.0
6-
nodejs 18.18.2
7-
gitleaks 8.18.4
8-
tfsec 1.28.10
98
terraform-docs 0.19.0
9+
trivy 0.61.0
1010
vale 3.6.0
1111

1212

infrastructure/modules/amp_branch/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
| <a name="input_environment_variables"></a> [environment\_variables](#input\_environment\_variables) | Environment variables to be used for amplify branch | `map(string)` | `{}` | no |
2525
| <a name="input_framework"></a> [framework](#input\_framework) | Set what framework to use | `string` | `null` | no |
2626
| <a name="input_group"></a> [group](#input\_group) | The group variables are being inherited from (often synonmous with account short-name) | `string` | n/a | yes |
27-
| <a name="input_module"></a> [module](#input\_module) | The name of this module. This is a special variable, it should be set only here and never overridden. | `string` | `"kms"` | no |
2827
| <a name="input_name"></a> [name](#input\_name) | A unique name to distinguish this module invocation from others within the same CSI scope | `string` | n/a | yes |
2928
| <a name="input_project"></a> [project](#input\_project) | The name of the terraformscaffold project calling the module | `string` | n/a | yes |
3029
| <a name="input_region"></a> [region](#input\_region) | The AWS Region | `string` | n/a | yes |

infrastructure/modules/amp_branch/locals.tf

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
11
locals {
2+
module = "amp"
3+
24
csi = format(
3-
"%s-%s-%s-%s-%s",
5+
"%s-%s-%s-%s",
46
var.project,
57
var.environment,
68
var.component,
7-
var.module,
89
var.name,
910
)
1011

11-
# CSI for use in resources with an account namespace, eg IAM roles
12-
csi_account = replace(
13-
format(
14-
"%s-%s-%s-%s-%s-%s",
15-
var.project,
16-
var.region,
17-
var.environment,
18-
var.component,
19-
var.module,
20-
var.name,
21-
),
22-
"_",
23-
"",
24-
)
25-
2612
default_tags = merge(
2713
var.default_tags,
2814
{
29-
Module = var.module
15+
Module = local.module
3016
Name = local.csi
3117
},
3218
)

infrastructure/modules/amp_branch/variables.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ variable "description" {
3232
description = "Description for the branch"
3333
}
3434

35-
##
36-
# Module self-identification
37-
##
38-
39-
variable "module" {
40-
type = string
41-
description = "The name of this module. This is a special variable, it should be set only here and never overridden."
42-
default = "kms"
43-
}
44-
4535
##
4636
# Variable specific to the module
4737
##

infrastructure/modules/aws-backup-source/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ No requirements.
6262
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | Default tag map for application to all taggable resources in the module | `map(string)` | `{}` | no |
6363
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the environment where AWS Backup is configured. | `string` | n/a | yes |
6464
| <a name="input_management_ci_role_arn"></a> [management\_ci\_role\_arn](#input\_management\_ci\_role\_arn) | ARN of Terraform role used to deploy to account | `string` | n/a | yes |
65+
| <a name="input_name"></a> [name](#input\_name) | The variable encapsulating the name of this bucket | `string` | n/a | yes |
6566
| <a name="input_notification_kms_key"></a> [notification\_kms\_key](#input\_notification\_kms\_key) | The ARN of the bootstrap KMS key used for encryption at rest of the SNS topic. | `string` | n/a | yes |
6667
| <a name="input_notifications_target_email_address"></a> [notifications\_target\_email\_address](#input\_notifications\_target\_email\_address) | The email address to which backup notifications will be sent via SNS. | `string` | `""` | no |
6768
| <a name="input_principal_org_id"></a> [principal\_org\_id](#input\_principal\_org\_id) | The AWS Org ID (numeric) | `string` | n/a | yes |

0 commit comments

Comments
 (0)