Skip to content

Commit

Permalink
Fixed cloudformation lint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Aug 21, 2024
1 parent 4d54f26 commit f134619
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 194 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Resources:
AiLabExampleDataBucket:
Type: 'AWS::S3::Bucket'
Properties:
AccessControl: 'Private'
Metadata:
Comment: 'Bucket to store example data for the AI-Lab'
DeletionPolicy: Retain
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Resources:
VMBucket:
Type: 'AWS::S3::Bucket'
Properties:
AccessControl: 'Private'
Metadata:
Comment: 'Bucket to store AI-Lab VM images'
DeletionPolicy: Retain
Expand Down
6 changes: 4 additions & 2 deletions test/aws/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DEFAULT_ASSET_ID = AssetId("test", stack_prefix="test-stack", ami_prefix="test-ami")
TEST_IP = "1.1.1.1"
TEST_ACL_ARN = "TEST-DOWNLOAD-ACL"
TEST_DUMMY_AMI_ID = "ami-123"
TEST_DUMMY_AMI_ID = "ami-00000000000000000"


def ci_codebuild_template():
Expand All @@ -20,12 +20,14 @@ def ci_codebuild_template():
)


# pattern for valid ARNs:
# (^arn:(aws|aws-cn|aws-us-gov):[^:]+:[^:]*(:(?:\\d{12}|\\*|aws)?:.+|)|\\*)$
def release_codebuild_template():
return render_template(
"release_code_build.jinja.yaml",
vm_bucket="test-bucket-123",
path_in_bucket=AssetId.BUCKET_PREFIX,
dockerhub_secret_arn="secret_arn",
dockerhub_secret_arn="arn:aws:_:_",
)


Expand Down
132 changes: 0 additions & 132 deletions test/unit/aws/rendered-cf-templates/vm-bucket-old.yml

This file was deleted.

53 changes: 0 additions & 53 deletions test/unit/aws/rendered-cf-templates/vm-bucket-waf-old.yml

This file was deleted.

2 changes: 0 additions & 2 deletions test/unit/aws/rendered-cf-templates/vm-bucket.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Resources:
VMBucket:
Type: 'AWS::S3::Bucket'
Properties:
AccessControl: 'Private'
Metadata:
Comment: 'Bucket to store AI-Lab VM images'
DeletionPolicy: Retain
Expand Down
1 change: 0 additions & 1 deletion test/unit/aws/test_lint_cloudformation_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def validate_using_cfn_lint(tmp_path, cloudformation_yml):
def test_lint_cloudformation_templates(tmp_path, template_key):
validate_using_cfn_lint(tmp_path, TEMPLATES[template_key])


@pytest.mark.parametrize("key", ("vm-bucket", "vm-bucket-waf"))
def test_template_rendering(key):
expected = (
Expand Down

0 comments on commit f134619

Please sign in to comment.