-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40235 from madhavvishnubhatta/f-vpc_block_public_…
…access_exclusion New resource - aws_vpc_block_public_access_exclusion
- Loading branch information
Showing
21 changed files
with
3,110 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:new-resource | ||
aws_vpc_block_public_access_exclusion | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
internal/service/ec2/testdata/BlockPublicAccessExclusion/tags/main_gen.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
resource "aws_vpc" "test" { | ||
cidr_block = "10.1.0.0/16" | ||
} | ||
|
||
resource "aws_vpc_block_public_access_exclusion" "test" { | ||
internet_gateway_exclusion_mode = "allow-bidirectional" | ||
vpc_id = aws_vpc.test.id | ||
|
||
tags = var.resource_tags | ||
} | ||
|
||
variable "resource_tags" { | ||
description = "Tags to set on resource. To specify no tags, set to `null`" | ||
# Not setting a default, so that this must explicitly be set to `null` to specify no tags | ||
type = map(string) | ||
nullable = true | ||
} |
24 changes: 24 additions & 0 deletions
24
internal/service/ec2/testdata/BlockPublicAccessExclusion/tagsComputed1/main_gen.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
provider "null" {} | ||
|
||
resource "aws_vpc" "test" { | ||
cidr_block = "10.1.0.0/16" | ||
} | ||
|
||
resource "aws_vpc_block_public_access_exclusion" "test" { | ||
internet_gateway_exclusion_mode = "allow-bidirectional" | ||
vpc_id = aws_vpc.test.id | ||
|
||
tags = { | ||
(var.unknownTagKey) = null_resource.test.id | ||
} | ||
} | ||
|
||
resource "null_resource" "test" {} | ||
|
||
variable "unknownTagKey" { | ||
type = string | ||
nullable = false | ||
} |
35 changes: 35 additions & 0 deletions
35
internal/service/ec2/testdata/BlockPublicAccessExclusion/tagsComputed2/main_gen.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
provider "null" {} | ||
|
||
resource "aws_vpc" "test" { | ||
cidr_block = "10.1.0.0/16" | ||
} | ||
|
||
resource "aws_vpc_block_public_access_exclusion" "test" { | ||
internet_gateway_exclusion_mode = "allow-bidirectional" | ||
vpc_id = aws_vpc.test.id | ||
|
||
tags = { | ||
(var.unknownTagKey) = null_resource.test.id | ||
(var.knownTagKey) = var.knownTagValue | ||
} | ||
} | ||
|
||
resource "null_resource" "test" {} | ||
|
||
variable "unknownTagKey" { | ||
type = string | ||
nullable = false | ||
} | ||
|
||
variable "knownTagKey" { | ||
type = string | ||
nullable = false | ||
} | ||
|
||
variable "knownTagValue" { | ||
type = string | ||
nullable = false | ||
} |
31 changes: 31 additions & 0 deletions
31
internal/service/ec2/testdata/BlockPublicAccessExclusion/tags_defaults/main_gen.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
provider "aws" { | ||
default_tags { | ||
tags = var.provider_tags | ||
} | ||
} | ||
|
||
resource "aws_vpc" "test" { | ||
cidr_block = "10.1.0.0/16" | ||
} | ||
|
||
resource "aws_vpc_block_public_access_exclusion" "test" { | ||
internet_gateway_exclusion_mode = "allow-bidirectional" | ||
vpc_id = aws_vpc.test.id | ||
|
||
tags = var.resource_tags | ||
} | ||
|
||
variable "resource_tags" { | ||
description = "Tags to set on resource. To specify no tags, set to `null`" | ||
# Not setting a default, so that this must explicitly be set to `null` to specify no tags | ||
type = map(string) | ||
nullable = true | ||
} | ||
|
||
variable "provider_tags" { | ||
type = map(string) | ||
nullable = false | ||
} |
40 changes: 40 additions & 0 deletions
40
internal/service/ec2/testdata/BlockPublicAccessExclusion/tags_ignore/main_gen.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
provider "aws" { | ||
default_tags { | ||
tags = var.provider_tags | ||
} | ||
ignore_tags { | ||
keys = var.ignore_tag_keys | ||
} | ||
} | ||
|
||
resource "aws_vpc" "test" { | ||
cidr_block = "10.1.0.0/16" | ||
} | ||
|
||
resource "aws_vpc_block_public_access_exclusion" "test" { | ||
internet_gateway_exclusion_mode = "allow-bidirectional" | ||
vpc_id = aws_vpc.test.id | ||
|
||
tags = var.resource_tags | ||
} | ||
|
||
variable "resource_tags" { | ||
description = "Tags to set on resource. To specify no tags, set to `null`" | ||
# Not setting a default, so that this must explicitly be set to `null` to specify no tags | ||
type = map(string) | ||
nullable = true | ||
} | ||
|
||
variable "provider_tags" { | ||
type = map(string) | ||
nullable = true | ||
default = null | ||
} | ||
|
||
variable "ignore_tag_keys" { | ||
type = set(string) | ||
nullable = false | ||
} |
10 changes: 10 additions & 0 deletions
10
internal/service/ec2/testdata/tmpl/vpc_block_public_access_exclusion_tags.gtpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
resource "aws_vpc" "test" { | ||
cidr_block = "10.1.0.0/16" | ||
} | ||
|
||
resource "aws_vpc_block_public_access_exclusion" "test" { | ||
internet_gateway_exclusion_mode = "allow-bidirectional" | ||
vpc_id = aws_vpc.test.id | ||
|
||
{{- template "tags" . }} | ||
} |
Oops, something went wrong.