Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation: inline rules for SecurityGroup and NetworkAcl resources #3729

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions provider/cmd/pulumi-resource-aws/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -215973,14 +215973,16 @@
"items": {
"$ref": "#/types/aws:ec2/NetworkAclEgress:NetworkAclEgress"
},
"description": "Specifies an egress rule. Parameters defined below.\n"
"description": "Specifies an egress rule. Parameters defined below.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"ingress": {
"type": "array",
"items": {
"$ref": "#/types/aws:ec2/NetworkAclIngress:NetworkAclIngress"
},
"description": "Specifies an ingress rule. Parameters defined below.\n"
"description": "Specifies an ingress rule. Parameters defined below.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"ownerId": {
"type": "string",
Expand Down Expand Up @@ -216028,14 +216030,16 @@
"items": {
"$ref": "#/types/aws:ec2/NetworkAclEgress:NetworkAclEgress"
},
"description": "Specifies an egress rule. Parameters defined below.\n"
"description": "Specifies an egress rule. Parameters defined below.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"ingress": {
"type": "array",
"items": {
"$ref": "#/types/aws:ec2/NetworkAclIngress:NetworkAclIngress"
},
"description": "Specifies an ingress rule. Parameters defined below.\n"
"description": "Specifies an ingress rule. Parameters defined below.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"subnetIds": {
"type": "array",
Expand Down Expand Up @@ -216072,14 +216076,16 @@
"items": {
"$ref": "#/types/aws:ec2/NetworkAclEgress:NetworkAclEgress"
},
"description": "Specifies an egress rule. Parameters defined below.\n"
"description": "Specifies an egress rule. Parameters defined below.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"ingress": {
"type": "array",
"items": {
"$ref": "#/types/aws:ec2/NetworkAclIngress:NetworkAclIngress"
},
"description": "Specifies an ingress rule. Parameters defined below.\n"
"description": "Specifies an ingress rule. Parameters defined below.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"ownerId": {
"type": "string",
Expand Down Expand Up @@ -217989,14 +217995,16 @@
"items": {
"$ref": "#/types/aws:ec2/SecurityGroupEgress:SecurityGroupEgress"
},
"description": "Configuration block for egress rules. Can be specified multiple times for each egress rule. Each egress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n"
"description": "Configuration block for egress rules. Can be specified multiple times for each egress rule. Each egress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"ingress": {
"type": "array",
"items": {
"$ref": "#/types/aws:ec2/SecurityGroupIngress:SecurityGroupIngress"
},
"description": "Configuration block for ingress rules. Can be specified multiple times for each ingress rule. Each ingress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n"
"description": "Configuration block for ingress rules. Can be specified multiple times for each ingress rule. Each ingress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"name": {
"type": "string",
Expand Down Expand Up @@ -218057,14 +218065,16 @@
"items": {
"$ref": "#/types/aws:ec2/SecurityGroupEgress:SecurityGroupEgress"
},
"description": "Configuration block for egress rules. Can be specified multiple times for each egress rule. Each egress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n"
"description": "Configuration block for egress rules. Can be specified multiple times for each egress rule. Each egress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"ingress": {
"type": "array",
"items": {
"$ref": "#/types/aws:ec2/SecurityGroupIngress:SecurityGroupIngress"
},
"description": "Configuration block for ingress rules. Can be specified multiple times for each ingress rule. Each ingress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n"
"description": "Configuration block for ingress rules. Can be specified multiple times for each ingress rule. Each ingress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"name": {
"type": "string",
Expand Down Expand Up @@ -218111,14 +218121,16 @@
"items": {
"$ref": "#/types/aws:ec2/SecurityGroupEgress:SecurityGroupEgress"
},
"description": "Configuration block for egress rules. Can be specified multiple times for each egress rule. Each egress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n"
"description": "Configuration block for egress rules. Can be specified multiple times for each egress rule. Each egress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"ingress": {
"type": "array",
"items": {
"$ref": "#/types/aws:ec2/SecurityGroupIngress:SecurityGroupIngress"
},
"description": "Configuration block for ingress rules. Can be specified multiple times for each ingress rule. Each ingress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n"
"description": "Configuration block for ingress rules. Can be specified multiple times for each ingress rule. Each ingress block supports fields documented below. This argument is processed in attribute-as-blocks mode.\n",
"deprecationMessage": "Use of inline rules is discouraged as they cannot be used in conjunction with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules."
},
"name": {
"type": "string",
Expand Down
44 changes: 40 additions & 4 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -1819,8 +1819,26 @@ func ProviderFromMeta(metaInfo *tfbridge.MetadataInfo) *tfbridge.ProviderInfo {
Tok: awsResource(ec2Mod, "NetworkAcl"),
Fields: map[string]*tfbridge.SchemaInfo{
// Use "ingress" instead of "ingresses" to match AWS APIs
"ingress": {Name: "ingress"},
"egress": {Name: "egress"},
"ingress": {
Name: "ingress",
DeprecationMessage: "Use of inline rules is discouraged as they cannot be used in conjunction " +
"with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules.",
},
"egress": {
Name: "egress",
DeprecationMessage: "Use of inline rules is discouraged as they cannot be used in conjunction " +
"with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules.",
},
},
PreCheckCallback: func(ctx context.Context, config resource.PropertyMap, meta resource.PropertyMap,
) (resource.PropertyMap, error) {
_, hasIngress := config["ingress"]
_, hasEgress := config["egress"]
if hasIngress || hasEgress {
tfbridge.GetLogger(ctx).Warn("Use of inline rules is discouraged as they cannot be used in conjunction " +
"with any Network ACL Rule resources. Doing so will cause a conflict and may overwrite rules.")
}
return config, nil
},
},
"aws_default_network_acl": {
Expand Down Expand Up @@ -1879,8 +1897,26 @@ func ProviderFromMeta(metaInfo *tfbridge.MetadataInfo) *tfbridge.ProviderInfo {
Fields: map[string]*tfbridge.SchemaInfo{
"description": {Default: managedByPulumi},
// Use "ingress" instead of "ingresses" to match AWS APIs
"ingress": {Name: "ingress"},
"egress": {Name: "egress"},
"ingress": {
Name: "ingress",
DeprecationMessage: "Use of inline rules is discouraged as they cannot be used in conjunction " +
"with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules.",
},
"egress": {
Name: "egress",
DeprecationMessage: "Use of inline rules is discouraged as they cannot be used in conjunction " +
"with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules.",
},
},
PreCheckCallback: func(ctx context.Context, config resource.PropertyMap, meta resource.PropertyMap,
) (resource.PropertyMap, error) {
_, hasIngress := config["ingress"]
_, hasEgress := config["egress"]
if hasIngress || hasEgress {
tfbridge.GetLogger(ctx).Warn("Use of inline rules is discouraged as they cannot be used in conjunction " +
"with any Security Group Rule resources. Doing so will cause a conflict and may overwrite rules.")
}
return config, nil
},
},
"aws_network_interface_sg_attachment": {Tok: awsResource(ec2Mod, "NetworkInterfaceSecurityGroupAttachment")},
Expand Down
4 changes: 4 additions & 0 deletions sdk/dotnet/Ec2/NetworkAcl.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions sdk/dotnet/Ec2/SecurityGroup.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading