Skip to content

Commit

Permalink
fix tags so they update with name and flag (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsinger-klotho authored Mar 19, 2024
1 parent 3410723 commit 314e6b0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
15 changes: 15 additions & 0 deletions pkg/engine/testdata/vpc_import.expect.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
resources:
aws:subnet:vpc:subnet1:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: subnet1
Type: private
Vpc: aws:vpc:vpc
imported: true
aws:subnet:vpc:subnet2:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: subnet2
Type: private
Vpc: aws:vpc:vpc
imported: true
aws:subnet:vpc:subnet3:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: subnet3
Type: public
Vpc: aws:vpc:vpc
imported: true
aws:subnet:vpc:subnet4:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: subnet4
Type: public
Vpc: aws:vpc:vpc
imported: true
aws:vpc:vpc:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: vpc
imported: true
edges:
aws:subnet:vpc:subnet1 -> aws:vpc:vpc:
Expand Down
15 changes: 15 additions & 0 deletions pkg/engine/testdata/vpc_import_to_lambda.expect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ resources:
RESOURCE_NAME: lambda_function-security_group
Vpc: aws:vpc:vpc
aws:subnet:subnet3:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: subnet3
Type: public
Vpc: aws:vpc:vpc
imported: true
aws:subnet:subnet4:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: subnet4
Type: public
Vpc: aws:vpc:vpc
imported: true
Expand Down Expand Up @@ -61,10 +67,16 @@ resources:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: lambda_function-ExecutionRole
aws:subnet:subnet1:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: subnet1
Type: private
Vpc: aws:vpc:vpc
imported: true
aws:subnet:subnet2:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: subnet2
Type: private
Vpc: aws:vpc:vpc
imported: true
Expand All @@ -75,6 +87,9 @@ resources:
RESOURCE_NAME: lambda_function-image-ecr_repo
aws:SERVICE_API:lambda_function-lambda_function-log-group:
aws:vpc:vpc:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: vpc
imported: true
aws:log_group:lambda_function-log-group:
LogGroupName: /aws/lambda/lambda_function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ resources:
RESOURCE_NAME: internet_gateway-0
Vpc: aws:vpc:vpc
aws:vpc:vpc:
Tags:
GLOBAL_KLOTHO_TAG: ""
RESOURCE_NAME: vpc
imported: true
edges:
aws:security_group:vpc:lambda_function-security_group -> aws:lambda_function:lambda_function:
Expand Down
6 changes: 5 additions & 1 deletion pkg/templates/aws/models/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ properties:
type: map(string,string)
default_value:
RESOURCE_NAME: '{{ .Self.Name }}'
GLOBAL_KLOTHO_TAG: '{{ .Tag }}'
GLOBAL_KLOTHO_TAG: '{{ .Tag }}'
operational_rule:
value:
RESOURCE_NAME: '{{ .Self.Name }}'
GLOBAL_KLOTHO_TAG: '{{ .Tag }}'

0 comments on commit 314e6b0

Please sign in to comment.