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

r/aws_networkmanager_core_network #28155

Merged
merged 24 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d5bf264
feat(netm): core network schema
GlennChia Dec 3, 2022
4b95f03
feat(netm): core network read
GlennChia Dec 3, 2022
a6d8c03
feat(netm): core network create
GlennChia Dec 3, 2022
b4e92f6
feat(netm): core network update
GlennChia Dec 3, 2022
ff42c13
feat(netm): core network provider
GlennChia Dec 3, 2022
058f7cf
test(netm): core network basic
GlennChia Dec 3, 2022
c946440
test(netm): core network disappears
GlennChia Dec 3, 2022
4018ca6
test(netm): core network tags
GlennChia Dec 3, 2022
a878cbf
test(netm): core network description
GlennChia Dec 3, 2022
1545696
test(netm): core network policy document
GlennChia Dec 3, 2022
4a54b44
docs(netm): core network
GlennChia Dec 3, 2022
f5ec9f0
ci(netm): core network changelog
GlennChia Dec 3, 2022
2970f94
ci(netm): suppress golangci-lint unparam
GlennChia Dec 3, 2022
a82ed0b
test(netm): hard coded region to client.Region
GlennChia Dec 3, 2022
26ba2f0
docs(netm): core network timeout options
GlennChia Dec 4, 2022
51767bb
r/aws_networkmanager_core_network: Cosmetics.
ewbankkit Dec 6, 2022
9deeeb3
Sweep Network Manager Connect Attachments and Network Manager Site To…
ewbankkit Dec 6, 2022
12f814c
r/aws_networkmanager_core_network: 'edges' and 'segments' are NewComp…
ewbankkit Dec 6, 2022
10eb2ef
r/aws_ec2_transit_gateway_policy_table_association: Use 'aws_networkm…
ewbankkit Dec 6, 2022
7364c19
r/aws_networkmanager_connect_attachment: Use 'aws_networkmanager_core…
ewbankkit Dec 6, 2022
3fe6316
r/aws_networkmanager_transit_gateway_route_table_attachment: Use 'aws…
ewbankkit Dec 6, 2022
bcd7943
r/aws_networkmanager_vpc_attachment: Use 'aws_networkmanager_core_net…
ewbankkit Dec 6, 2022
a9c7a8d
r/aws_networkmanager_transit_gateway_peering: Use 'aws_networkmanager…
ewbankkit Dec 6, 2022
3d3b7ea
r/aws_networkmanager_site_to_site_vpn_attachment: Use 'aws_networkman…
ewbankkit Dec 7, 2022
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
3 changes: 3 additions & 0 deletions .changelog/28155.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_networkmanager_core_network
```
1 change: 1 addition & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,7 @@ func New(_ context.Context) (*schema.Provider, error) {
"aws_networkmanager_attachment_accepter": networkmanager.ResourceAttachmentAccepter(),
"aws_networkmanager_connect_attachment": networkmanager.ResourceConnectAttachment(),
"aws_networkmanager_connection": networkmanager.ResourceConnection(),
"aws_networkmanager_core_network": networkmanager.ResourceCoreNetwork(),
"aws_networkmanager_customer_gateway_association": networkmanager.ResourceCustomerGatewayAssociation(),
"aws_networkmanager_device": networkmanager.ResourceDevice(),
"aws_networkmanager_global_network": networkmanager.ResourceGlobalNetwork(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,12 @@ func testAccTransitGatewayPolicyTableAssociation_basic(t *testing.T) {
resourceName := "aws_ec2_transit_gateway_policy_table_association.test"
transitGatewayPolicyTableResourceName := "aws_ec2_transit_gateway_policy_table.test"
transitGatewayPeeringResourceName := "aws_networkmanager_transit_gateway_peering.test"
testExternalProviders := map[string]resource.ExternalProvider{
"awscc": {
Source: "hashicorp/awscc",
VersionConstraint: "0.29.0",
},
}
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(t) },
ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
ExternalProviders: testExternalProviders,
CheckDestroy: testAccCheckTransitGatewayPolicyTableAssociationDestroy,
Steps: []resource.TestStep{
{
Expand All @@ -56,19 +49,12 @@ func testAccTransitGatewayPolicyTableAssociation_basic(t *testing.T) {
func testAccTransitGatewayPolicyTableAssociation_disappears(t *testing.T) {
var v ec2.TransitGatewayPolicyTableAssociation
resourceName := "aws_ec2_transit_gateway_policy_table_association.test"
testExternalProviders := map[string]resource.ExternalProvider{
"awscc": {
Source: "hashicorp/awscc",
VersionConstraint: "0.29.0",
},
}
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(t) },
ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
ExternalProviders: testExternalProviders,
CheckDestroy: testAccCheckTransitGatewayPolicyTableAssociationDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -168,9 +154,13 @@ resource "aws_networkmanager_global_network" "test" {
}
}

resource "awscc_networkmanager_core_network" "test" {
resource "aws_networkmanager_core_network" "test" {
global_network_id = aws_networkmanager_global_network.test.id
policy_document = jsonencode(jsondecode(data.aws_networkmanager_core_network_policy_document.test.json))
policy_document = data.aws_networkmanager_core_network_policy_document.test.json

tags = {
Name = %[1]q
}
}

data "aws_networkmanager_core_network_policy_document" "test" {
Expand All @@ -189,7 +179,7 @@ data "aws_networkmanager_core_network_policy_document" "test" {
}

resource "aws_networkmanager_transit_gateway_peering" "test" {
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
transit_gateway_arn = aws_ec2_transit_gateway.test.arn

tags = {
Expand Down
52 changes: 14 additions & 38 deletions internal/service/networkmanager/connect_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,12 @@ import (
func TestAccNetworkManagerConnectAttachment_basic(t *testing.T) {
var v networkmanager.ConnectAttachment
resourceName := "aws_networkmanager_connect_attachment.test"
testExternalProviders := map[string]resource.ExternalProvider{
"awscc": {
Source: "hashicorp/awscc",
VersionConstraint: "0.29.0",
},
}
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
ExternalProviders: testExternalProviders,
CheckDestroy: testAccCheckConnectAttachmentDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -60,19 +53,12 @@ func TestAccNetworkManagerConnectAttachment_basic(t *testing.T) {
func TestAccNetworkManagerConnectAttachment_basic_NoDependsOn(t *testing.T) {
var v networkmanager.ConnectAttachment
resourceName := "aws_networkmanager_connect_attachment.test"
testExternalProviders := map[string]resource.ExternalProvider{
"awscc": {
Source: "hashicorp/awscc",
VersionConstraint: "0.29.0",
},
}
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
ExternalProviders: testExternalProviders,
CheckDestroy: testAccCheckConnectAttachmentDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -101,19 +87,12 @@ func TestAccNetworkManagerConnectAttachment_basic_NoDependsOn(t *testing.T) {
func TestAccNetworkManagerConnectAttachment_disappears(t *testing.T) {
var v networkmanager.ConnectAttachment
resourceName := "aws_networkmanager_connect_attachment.test"
testExternalProviders := map[string]resource.ExternalProvider{
"awscc": {
Source: "hashicorp/awscc",
VersionConstraint: "0.29.0",
},
}
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
ExternalProviders: testExternalProviders,
CheckDestroy: testAccCheckConnectAttachmentDestroy,
Steps: []resource.TestStep{
{
Expand All @@ -131,19 +110,12 @@ func TestAccNetworkManagerConnectAttachment_disappears(t *testing.T) {
func TestAccNetworkManagerConnectAttachment_tags(t *testing.T) {
var v networkmanager.ConnectAttachment
resourceName := "aws_networkmanager_connect_attachment.test"
testExternalProviders := map[string]resource.ExternalProvider{
"awscc": {
Source: "hashicorp/awscc",
VersionConstraint: "0.29.0",
},
}
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(t) },
ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
ExternalProviders: testExternalProviders,
CheckDestroy: testAccCheckConnectAttachmentDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -264,9 +236,13 @@ resource "aws_networkmanager_global_network" "test" {
}
}

resource "awscc_networkmanager_core_network" "test" {
resource "aws_networkmanager_core_network" "test" {
global_network_id = aws_networkmanager_global_network.test.id
policy_document = jsonencode(jsondecode(data.aws_networkmanager_core_network_policy_document.test.json))
policy_document = data.aws_networkmanager_core_network_policy_document.test.json

tags = {
Name = %[1]q
}
}

data "aws_networkmanager_core_network_policy_document" "test" {
Expand Down Expand Up @@ -312,7 +288,7 @@ func testAccConnectAttachmentConfig_basic(rName string) string {
return acctest.ConfigCompose(testAccConnectAttachmentConfig_base(rName), `
resource "aws_networkmanager_vpc_attachment" "test" {
subnet_arns = aws_subnet.test[*].arn
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
vpc_arn = aws_vpc.test.arn
tags = {
segment = "shared"
Expand All @@ -325,7 +301,7 @@ resource "aws_networkmanager_attachment_accepter" "test" {
}

resource "aws_networkmanager_connect_attachment" "test" {
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
transport_attachment_id = aws_networkmanager_vpc_attachment.test.id
edge_location = aws_networkmanager_vpc_attachment.test.edge_location
options {
Expand All @@ -350,7 +326,7 @@ func testAccConnectAttachmentConfig_basic_NoDependsOn(rName string) string {
return acctest.ConfigCompose(testAccConnectAttachmentConfig_base(rName), `
resource "aws_networkmanager_vpc_attachment" "test" {
subnet_arns = aws_subnet.test[*].arn
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
vpc_arn = aws_vpc.test.arn
tags = {
segment = "shared"
Expand All @@ -363,7 +339,7 @@ resource "aws_networkmanager_attachment_accepter" "test" {
}

resource "aws_networkmanager_connect_attachment" "test" {
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
transport_attachment_id = aws_networkmanager_vpc_attachment.test.id
edge_location = aws_networkmanager_vpc_attachment.test.edge_location
options {
Expand All @@ -385,7 +361,7 @@ func testAccConnectAttachmentConfig_tags1(rName, tagKey1, tagValue1 string) stri
return acctest.ConfigCompose(testAccConnectAttachmentConfig_base(rName), fmt.Sprintf(`
resource "aws_networkmanager_vpc_attachment" "test" {
subnet_arns = [aws_subnet.test[0].arn]
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
vpc_arn = aws_vpc.test.arn
tags = {
segment = "shared"
Expand All @@ -398,7 +374,7 @@ resource "aws_networkmanager_attachment_accepter" "test" {
}

resource "aws_networkmanager_connect_attachment" "test" {
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
transport_attachment_id = aws_networkmanager_vpc_attachment.test.id
edge_location = aws_networkmanager_vpc_attachment.test.edge_location
options {
Expand All @@ -423,7 +399,7 @@ func testAccConnectAttachmentConfig_tags2(rName, tagKey1, tagValue1, tagKey2, ta
return acctest.ConfigCompose(testAccConnectAttachmentConfig_base(rName), fmt.Sprintf(`
resource "aws_networkmanager_vpc_attachment" "test" {
subnet_arns = [aws_subnet.test[0].arn]
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
vpc_arn = aws_vpc.test.arn
tags = {
segment = "shared"
Expand All @@ -436,7 +412,7 @@ resource "aws_networkmanager_attachment_accepter" "test" {
}

resource "aws_networkmanager_connect_attachment" "test" {
core_network_id = awscc_networkmanager_core_network.test.id
core_network_id = aws_networkmanager_core_network.test.id
transport_attachment_id = aws_networkmanager_vpc_attachment.test.id
edge_location = aws_networkmanager_vpc_attachment.test.edge_location
options {
Expand Down
Loading