Skip to content

Commit

Permalink
Live pulumi state (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsinger-klotho authored Mar 6, 2024
1 parent 27bd3c2 commit 9bd926f
Show file tree
Hide file tree
Showing 53 changed files with 1,390 additions and 694 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/govulncheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.22.0'
go-version: '1.22.1'
- uses: actions/cache@v2
with:
path: |
Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/operational_eval/vertex_path_expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ func (runner *pathExpandVertexRunner) handleResultProperties(
knowledgebase.DynamicValueData{Resource: res.ID},
targetRes,
)
if canUse && err == nil {
if canUse && err == nil && !res.Imported {
err = opRuleCtx.SetField(res, targetRes, step)
if err != nil {
errs = errors.Join(errs, err)
Expand Down
26 changes: 13 additions & 13 deletions pkg/engine/testdata/2_routes.dataflow-viz.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
provider: aws
resources:
lambda_function/lambda_function_1:
children:
- aws:ecr_image:lambda_function_1-image
- aws:ecr_repo:lambda_function_1-image-ecr_repo
- aws:iam_role:lambda_function_1-ExecutionRole
tag: big

lambda_function/lambda_function_0:
children:
- aws:ecr_image:lambda_function_0-image
- aws:ecr_repo:lambda_function_0-image-ecr_repo
- aws:iam_role:lambda_function_0-ExecutionRole
tag: big

lambda_function/lambda_function_1:
children:
- aws:ecr_image:lambda_function_1-image
- aws:ecr_repo:lambda_function_1-image-ecr_repo
- aws:iam_role:lambda_function_1-ExecutionRole
tag: big

rest_api/rest_api_1:
children:
- aws:api_deployment:rest_api_1:api_deployment-0
Expand All @@ -28,19 +28,19 @@ resources:
- aws:api_stage:rest_api_1:api_stage-0
tag: parent

aws:api_integration:rest_api_1/integ1:
aws:api_integration:rest_api_1/integ0:
parent: rest_api/rest_api_1
tag: big

aws:api_integration:rest_api_1/integ1 -> lambda_function/lambda_function_1:
aws:api_integration:rest_api_1/integ0 -> lambda_function/lambda_function_0:
path:
- aws:lambda_permission:integ1-lambda_function_1
- aws:lambda_permission:integ0-lambda_function_0

aws:api_integration:rest_api_1/integ0:
aws:api_integration:rest_api_1/integ1:
parent: rest_api/rest_api_1
tag: big

aws:api_integration:rest_api_1/integ0 -> lambda_function/lambda_function_0:
aws:api_integration:rest_api_1/integ1 -> lambda_function/lambda_function_1:
path:
- aws:lambda_permission:integ0-lambda_function_0
- aws:lambda_permission:integ1-lambda_function_1

50 changes: 25 additions & 25 deletions pkg/engine/testdata/2_routes.iac-viz.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
provider: aws
resources:
rest_api/rest_api_1:

ecr_repo/lambda_function_0-image-ecr_repo:

log_group/lambda_function_0-log-group:

ecr_repo/lambda_function_1-image-ecr_repo:

log_group/lambda_function_0-log-group:

log_group/lambda_function_1-log-group:

aws:api_resource:rest_api_1/lambda0:
rest_api/rest_api_1:

aws:api_resource:rest_api_1/lambda0 -> rest_api/rest_api_1:
ecr_image/lambda_function_0-image:

ecr_image/lambda_function_0-image -> ecr_repo/lambda_function_0-image-ecr_repo:
ecr_image/lambda_function_1-image:

ecr_image/lambda_function_1-image -> ecr_repo/lambda_function_1-image-ecr_repo:
iam_role/lambda_function_0-executionrole:

iam_role/lambda_function_0-executionrole -> log_group/lambda_function_0-log-group:
iam_role/lambda_function_1-executionrole:

iam_role/lambda_function_1-executionrole -> log_group/lambda_function_1-log-group:
aws:api_resource:rest_api_1/lambda0:

aws:api_resource:rest_api_1/lambda0 -> rest_api/rest_api_1:
aws:api_resource:rest_api_1/lambda1:

aws:api_resource:rest_api_1/lambda1 -> rest_api/rest_api_1:
ecr_image/lambda_function_1-image:
lambda_function/lambda_function_0:

ecr_image/lambda_function_1-image -> ecr_repo/lambda_function_1-image-ecr_repo:
iam_role/lambda_function_1-executionrole:
lambda_function/lambda_function_0 -> ecr_image/lambda_function_0-image:
lambda_function/lambda_function_0 -> iam_role/lambda_function_0-executionrole:
lambda_function/lambda_function_1:

iam_role/lambda_function_1-executionrole -> log_group/lambda_function_1-log-group:
lambda_function/lambda_function_1 -> ecr_image/lambda_function_1-image:
lambda_function/lambda_function_1 -> iam_role/lambda_function_1-executionrole:
aws:api_resource:rest_api_1/api_resource-0:

aws:api_resource:rest_api_1/api_resource-0 -> aws:api_resource:rest_api_1/lambda0:
aws:api_resource:rest_api_1/api_resource-0 -> rest_api/rest_api_1:
lambda_function/lambda_function_0:

lambda_function/lambda_function_0 -> ecr_image/lambda_function_0-image:
lambda_function/lambda_function_0 -> iam_role/lambda_function_0-executionrole:
aws:api_resource:rest_api_1/api_resource-1:

aws:api_resource:rest_api_1/api_resource-1 -> aws:api_resource:rest_api_1/lambda1:
aws:api_resource:rest_api_1/api_resource-1 -> rest_api/rest_api_1:
lambda_function/lambda_function_1:
lambda_permission/integ0-lambda_function_0:

lambda_function/lambda_function_1 -> ecr_image/lambda_function_1-image:
lambda_function/lambda_function_1 -> iam_role/lambda_function_1-executionrole:
lambda_permission/integ0-lambda_function_0 -> lambda_function/lambda_function_0:
lambda_permission/integ0-lambda_function_0 -> rest_api/rest_api_1:
lambda_permission/integ1-lambda_function_1:

lambda_permission/integ1-lambda_function_1 -> lambda_function/lambda_function_1:
lambda_permission/integ1-lambda_function_1 -> rest_api/rest_api_1:
aws:api_method:rest_api_1/integ0-api_method:

aws:api_method:rest_api_1/integ0-api_method -> aws:api_resource:rest_api_1/api_resource-0:
aws:api_method:rest_api_1/integ0-api_method -> rest_api/rest_api_1:
lambda_permission/integ0-lambda_function_0:

lambda_permission/integ0-lambda_function_0 -> lambda_function/lambda_function_0:
lambda_permission/integ0-lambda_function_0 -> rest_api/rest_api_1:
aws:api_method:rest_api_1/integ1-api_method:

aws:api_method:rest_api_1/integ1-api_method -> aws:api_resource:rest_api_1/api_resource-1:
aws:api_method:rest_api_1/integ1-api_method -> rest_api/rest_api_1:
lambda_permission/integ1-lambda_function_1:

lambda_permission/integ1-lambda_function_1 -> lambda_function/lambda_function_1:
lambda_permission/integ1-lambda_function_1 -> rest_api/rest_api_1:
aws:api_integration:rest_api_1/integ0:

aws:api_integration:rest_api_1/integ0 -> aws:api_method:rest_api_1/integ0-api_method:
Expand Down
14 changes: 7 additions & 7 deletions pkg/engine/testdata/cf_distribution.iac-viz.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
provider: aws
resources:
cloudfront_origin_access_identity/cloudfront_origin_access_identity-0:

rest_api/rest_api_1:

s3_bucket/s3-bucket-3:

aws:api_deployment:rest_api_1/api_deployment-0:

aws:api_deployment:rest_api_1/api_deployment-0 -> rest_api/rest_api_1:
cloudfront_origin_access_identity/cloudfront_origin_access_identity-0:

s3_bucket/s3-bucket-3:
s3_bucket_policy/s3_bucket_policy-0:

s3_bucket_policy/s3_bucket_policy-0 -> cloudfront_origin_access_identity/cloudfront_origin_access_identity-0:
s3_bucket_policy/s3_bucket_policy-0 -> s3_bucket/s3-bucket-3:
aws:api_stage:rest_api_1/cloudfront_distribution_2-rest_api_1:

aws:api_stage:rest_api_1/cloudfront_distribution_2-rest_api_1 -> aws:api_deployment:rest_api_1/api_deployment-0:
aws:api_stage:rest_api_1/cloudfront_distribution_2-rest_api_1 -> rest_api/rest_api_1:
s3_bucket_policy/s3_bucket_policy-0:

s3_bucket_policy/s3_bucket_policy-0 -> cloudfront_origin_access_identity/cloudfront_origin_access_identity-0:
s3_bucket_policy/s3_bucket_policy-0 -> s3_bucket/s3-bucket-3:
cloudfront_distribution/cloudfront_distribution_2:

cloudfront_distribution/cloudfront_distribution_2 -> aws:api_stage:rest_api_1/cloudfront_distribution_2-rest_api_1:
Expand Down
22 changes: 11 additions & 11 deletions pkg/engine/testdata/delete_api_to_lambda_edge.dataflow-viz.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
provider: aws
resources:
rest_api/rest_api_0:
children:
- aws:api_deployment:rest_api_0:api_deployment-0
- aws:api_integration:rest_api_0:rest_api_0_integration_0
- aws:api_method:rest_api_0:rest_api_0_integration_0_method
- aws:api_resource:rest_api_0:api_resource-0
- aws:api_stage:rest_api_0:api_stage-0
tag: parent
aws:api_integration:rest_api_0/rest_api_0_integration_0:
parent: rest_api/rest_api_0
tag: big

lambda_function/lambda_function_2:
children:
Expand All @@ -16,7 +11,12 @@ resources:
- aws:iam_role:lambda_function_2-ExecutionRole
tag: big

aws:api_integration:rest_api_0/rest_api_0_integration_0:
parent: rest_api/rest_api_0
tag: big
rest_api/rest_api_0:
children:
- aws:api_deployment:rest_api_0:api_deployment-0
- aws:api_integration:rest_api_0:rest_api_0_integration_0
- aws:api_method:rest_api_0:rest_api_0_integration_0_method
- aws:api_resource:rest_api_0:api_resource-0
- aws:api_stage:rest_api_0:api_stage-0
tag: parent

14 changes: 7 additions & 7 deletions pkg/engine/testdata/delete_api_to_lambda_edge.iac-viz.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
provider: aws
resources:
rest_api/rest_api_0:

ecr_repo/ecr_repo-0:

log_group/lambda_function_2-log-group:

aws:api_resource:rest_api_0/api_resource-0:
rest_api/rest_api_0:

aws:api_resource:rest_api_0/api_resource-0 -> rest_api/rest_api_0:
ecr_image/lambda_function_2-image:

ecr_image/lambda_function_2-image -> ecr_repo/ecr_repo-0:
iam_role/lambda_function_2-executionrole:

iam_role/lambda_function_2-executionrole -> log_group/lambda_function_2-log-group:
aws:api_method:rest_api_0/rest_api_0_integration_0_method:
aws:api_resource:rest_api_0/api_resource-0:

aws:api_method:rest_api_0/rest_api_0_integration_0_method -> aws:api_resource:rest_api_0/api_resource-0:
aws:api_method:rest_api_0/rest_api_0_integration_0_method -> rest_api/rest_api_0:
aws:api_resource:rest_api_0/api_resource-0 -> rest_api/rest_api_0:
lambda_function/lambda_function_2:

lambda_function/lambda_function_2 -> ecr_image/lambda_function_2-image:
lambda_function/lambda_function_2 -> iam_role/lambda_function_2-executionrole:
lambda_function/lambda_function_2 -> log_group/lambda_function_2-log-group:
aws:api_method:rest_api_0/rest_api_0_integration_0_method:

aws:api_method:rest_api_0/rest_api_0_integration_0_method -> aws:api_resource:rest_api_0/api_resource-0:
aws:api_method:rest_api_0/rest_api_0_integration_0_method -> rest_api/rest_api_0:
aws:api_integration:rest_api_0/rest_api_0_integration_0:

aws:api_integration:rest_api_0/rest_api_0_integration_0 -> aws:api_method:rest_api_0/rest_api_0_integration_0_method:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
provider: aws
resources:
aws:api_integration:rest_api_0/rest_api_0_integration_0:
parent: rest_api/rest_api_0
tag: big

rest_api/rest_api_0:
children:
- aws:api_deployment:rest_api_0:api_deployment-0
Expand All @@ -9,7 +13,3 @@ resources:
- aws:api_stage:rest_api_0:api_stage-0
tag: parent

aws:api_integration:rest_api_0/rest_api_0_integration_0:
parent: rest_api/rest_api_0
tag: big

4 changes: 2 additions & 2 deletions pkg/engine/testdata/delete_resource_and_iacdeps.iac-viz.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
provider: aws
resources:
ecs_cluster/ecs_cluster-0:

rest_api/rest_api_0:

aws:api_resource:rest_api_0/api_resource-0:
Expand All @@ -19,8 +21,6 @@ resources:
aws:api_deployment:rest_api_0/api_deployment-0 -> aws:api_integration:rest_api_0/rest_api_0_integration_0:
aws:api_deployment:rest_api_0/api_deployment-0 -> aws:api_method:rest_api_0/rest_api_0_integration_0_method:
aws:api_deployment:rest_api_0/api_deployment-0 -> rest_api/rest_api_0:
ecs_cluster/ecs_cluster-0:

aws:api_stage:rest_api_0/api_stage-0:

aws:api_stage:rest_api_0/api_stage-0 -> aws:api_deployment:rest_api_0/api_deployment-0:
Expand Down
Loading

0 comments on commit 9bd926f

Please sign in to comment.