diff --git a/pkg/engine/testdata/vpc_import.err.json b/pkg/engine/testdata/vpc_import.err.json index e75b59039..1c8224cbe 100644 --- a/pkg/engine/testdata/vpc_import.err.json +++ b/pkg/engine/testdata/vpc_import.err.json @@ -58,5 +58,65 @@ "resource": "aws:vpc:vpc", "validation_error": "required property CidrBlock is not set on resource aws:vpc:vpc", "value": null + }, + { + "error": { + "chain": [ + "required property Id is not set on resource aws:subnet:vpc:subnet1" + ] + }, + "error_code": "config_invalid", + "property": "Id", + "resource": "aws:subnet:vpc:subnet1", + "validation_error": "required property Id is not set on resource aws:subnet:vpc:subnet1", + "value": null + }, + { + "error": { + "chain": [ + "required property Id is not set on resource aws:subnet:vpc:subnet2" + ] + }, + "error_code": "config_invalid", + "property": "Id", + "resource": "aws:subnet:vpc:subnet2", + "validation_error": "required property Id is not set on resource aws:subnet:vpc:subnet2", + "value": null + }, + { + "error": { + "chain": [ + "required property Id is not set on resource aws:subnet:vpc:subnet3" + ] + }, + "error_code": "config_invalid", + "property": "Id", + "resource": "aws:subnet:vpc:subnet3", + "validation_error": "required property Id is not set on resource aws:subnet:vpc:subnet3", + "value": null + }, + { + "error": { + "chain": [ + "required property Id is not set on resource aws:subnet:vpc:subnet4" + ] + }, + "error_code": "config_invalid", + "property": "Id", + "resource": "aws:subnet:vpc:subnet4", + "validation_error": "required property Id is not set on resource aws:subnet:vpc:subnet4", + "value": null + }, + { + "error": { + "chain": [ + "required property Arn is not set on resource aws:vpc:vpc" + ] + }, + "error_code": "config_invalid", + "property": "Arn", + "resource": "aws:vpc:vpc", + "validation_error": "required property Arn is not set on resource aws:vpc:vpc", + "value": null } ] diff --git a/pkg/engine/testdata/vpc_import_to_lambda.err.json b/pkg/engine/testdata/vpc_import_to_lambda.err.json index 491168437..9f82940de 100644 --- a/pkg/engine/testdata/vpc_import_to_lambda.err.json +++ b/pkg/engine/testdata/vpc_import_to_lambda.err.json @@ -70,5 +70,65 @@ "resource": "aws:ecr_image:lambda_function-image", "validation_error": "required property BaseImage is not set on resource aws:ecr_image:lambda_function-image", "value": null + }, + { + "error": { + "chain": [ + "required property Id is not set on resource aws:subnet:subnet3" + ] + }, + "error_code": "config_invalid", + "property": "Id", + "resource": "aws:subnet:subnet3", + "validation_error": "required property Id is not set on resource aws:subnet:subnet3", + "value": null + }, + { + "error": { + "chain": [ + "required property Id is not set on resource aws:subnet:subnet4" + ] + }, + "error_code": "config_invalid", + "property": "Id", + "resource": "aws:subnet:subnet4", + "validation_error": "required property Id is not set on resource aws:subnet:subnet4", + "value": null + }, + { + "error": { + "chain": [ + "required property Id is not set on resource aws:subnet:vpc:subnet1" + ] + }, + "error_code": "config_invalid", + "property": "Id", + "resource": "aws:subnet:vpc:subnet1", + "validation_error": "required property Id is not set on resource aws:subnet:vpc:subnet1", + "value": null + }, + { + "error": { + "chain": [ + "required property Id is not set on resource aws:subnet:vpc:subnet2" + ] + }, + "error_code": "config_invalid", + "property": "Id", + "resource": "aws:subnet:vpc:subnet2", + "validation_error": "required property Id is not set on resource aws:subnet:vpc:subnet2", + "value": null + }, + { + "error": { + "chain": [ + "required property Arn is not set on resource aws:vpc:vpc" + ] + }, + "error_code": "config_invalid", + "property": "Arn", + "resource": "aws:vpc:vpc", + "validation_error": "required property Arn is not set on resource aws:vpc:vpc", + "value": null } ] diff --git a/pkg/engine/testdata/vpc_import_wo_subnets_to_lambda.err.json b/pkg/engine/testdata/vpc_import_wo_subnets_to_lambda.err.json index 07f50b172..aadfed9e1 100644 --- a/pkg/engine/testdata/vpc_import_wo_subnets_to_lambda.err.json +++ b/pkg/engine/testdata/vpc_import_wo_subnets_to_lambda.err.json @@ -22,5 +22,17 @@ "resource": "aws:ecr_image:lambda_function-image", "validation_error": "required property BaseImage is not set on resource aws:ecr_image:lambda_function-image", "value": null + }, + { + "error": { + "chain": [ + "required property Arn is not set on resource aws:vpc:vpc" + ] + }, + "error_code": "config_invalid", + "property": "Arn", + "resource": "aws:vpc:vpc", + "validation_error": "required property Arn is not set on resource aws:vpc:vpc", + "value": null } ] diff --git a/pkg/knowledgebase/properties/any_property.go b/pkg/knowledgebase/properties/any_property.go index 88035c267..255efc347 100644 --- a/pkg/knowledgebase/properties/any_property.go +++ b/pkg/knowledgebase/properties/any_property.go @@ -110,7 +110,7 @@ func (a *AnyProperty) Type() string { } func (a *AnyProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if a.DeployTime && value == nil { + if a.DeployTime && value == nil && !resource.Imported { return nil } if a.Required && value == nil { diff --git a/pkg/knowledgebase/properties/bool_property.go b/pkg/knowledgebase/properties/bool_property.go index c1ea013c8..ddd1a28f8 100644 --- a/pkg/knowledgebase/properties/bool_property.go +++ b/pkg/knowledgebase/properties/bool_property.go @@ -84,7 +84,7 @@ func (b *BoolProperty) Type() string { } func (b *BoolProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if b.DeployTime && value == nil { + if b.DeployTime && value == nil && !resource.Imported { return nil } if value == nil { diff --git a/pkg/knowledgebase/properties/float_property.go b/pkg/knowledgebase/properties/float_property.go index 05013e14f..8787516af 100644 --- a/pkg/knowledgebase/properties/float_property.go +++ b/pkg/knowledgebase/properties/float_property.go @@ -92,7 +92,7 @@ func (f *FloatProperty) Type() string { } func (f *FloatProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if f.DeployTime && value == nil { + if f.DeployTime && value == nil && !resource.Imported { return nil } if value == nil { diff --git a/pkg/knowledgebase/properties/int_property.go b/pkg/knowledgebase/properties/int_property.go index f4cc27181..dea5e6366 100644 --- a/pkg/knowledgebase/properties/int_property.go +++ b/pkg/knowledgebase/properties/int_property.go @@ -102,7 +102,7 @@ func (i *IntProperty) Type() string { } func (i *IntProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if i.DeployTime && value == nil { + if i.DeployTime && value == nil && !resource.Imported { return nil } if value == nil { diff --git a/pkg/knowledgebase/properties/list_property.go b/pkg/knowledgebase/properties/list_property.go index 0dea20bfc..d6bade667 100644 --- a/pkg/knowledgebase/properties/list_property.go +++ b/pkg/knowledgebase/properties/list_property.go @@ -168,7 +168,7 @@ func (l *ListProperty) Type() string { } func (l *ListProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if l.DeployTime && value == nil { + if l.DeployTime && value == nil && !resource.Imported { return nil } if value == nil { diff --git a/pkg/knowledgebase/properties/map_property.go b/pkg/knowledgebase/properties/map_property.go index 9f848e8bc..a8200b182 100644 --- a/pkg/knowledgebase/properties/map_property.go +++ b/pkg/knowledgebase/properties/map_property.go @@ -190,7 +190,7 @@ func (m *MapProperty) Type() string { } func (m *MapProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if m.DeployTime && value == nil { + if m.DeployTime && value == nil && !resource.Imported { return nil } if value == nil { diff --git a/pkg/knowledgebase/properties/resource_property.go b/pkg/knowledgebase/properties/resource_property.go index 48b592d8b..7da21ecc1 100644 --- a/pkg/knowledgebase/properties/resource_property.go +++ b/pkg/knowledgebase/properties/resource_property.go @@ -131,7 +131,7 @@ func (r *ResourceProperty) Type() string { } func (r *ResourceProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if r.DeployTime && value == nil { + if r.DeployTime && value == nil && !resource.Imported { return nil } if value == nil { diff --git a/pkg/knowledgebase/properties/set_property.go b/pkg/knowledgebase/properties/set_property.go index 73db37b46..f174a46e5 100644 --- a/pkg/knowledgebase/properties/set_property.go +++ b/pkg/knowledgebase/properties/set_property.go @@ -160,7 +160,7 @@ func (s *SetProperty) Type() string { } func (s *SetProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if s.DeployTime && value == nil { + if s.DeployTime && value == nil && !resource.Imported { return nil } if value == nil { diff --git a/pkg/knowledgebase/properties/string_property.go b/pkg/knowledgebase/properties/string_property.go index ec9399e26..b8bfcac19 100644 --- a/pkg/knowledgebase/properties/string_property.go +++ b/pkg/knowledgebase/properties/string_property.go @@ -93,7 +93,7 @@ func (s *StringProperty) Type() string { } func (s *StringProperty) Validate(resource *construct.Resource, value any, ctx knowledgebase.DynamicContext) error { - if s.DeployTime && value == nil { + if s.DeployTime && value == nil && !resource.Imported { return nil } if value == nil {