generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 117
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 #1972 from GlennChia/d-improve_network_insights_ac…
…cess_scope docs: ec2_network_insights_access_scope
- Loading branch information
Showing
5 changed files
with
256 additions
and
2 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
24 changes: 24 additions & 0 deletions
24
...s/awscc_ec2_network_insights_access_scope/source_resource_vpc_to_dest_resourcetype_igw.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 @@ | ||
|
||
resource "awscc_ec2_network_insights_access_scope" "example" { | ||
match_paths = [{ | ||
source = { | ||
resource_statement = { | ||
resources = [ | ||
aws_vpc.example.id | ||
] | ||
} | ||
} | ||
destination = { | ||
resource_statement = { | ||
resource_types = [ | ||
"AWS::EC2::InternetGateway" | ||
] | ||
} | ||
} | ||
}] | ||
|
||
tags = [{ | ||
key = "Name" | ||
value = "source-vpc-id-to-dest-igw" | ||
}] | ||
} |
31 changes: 31 additions & 0 deletions
31
...scc_ec2_network_insights_access_scope/source_resourcetype_ec2_to_dest_resourcetype_ec2.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 @@ | ||
resource "awscc_ec2_network_insights_access_scope" "example" { | ||
match_paths = [{ | ||
source = { | ||
resource_statement = { | ||
resource_types = [ | ||
"AWS::EC2::Instance" | ||
] | ||
} | ||
packet_header_statement = { | ||
source_addresses = [aws_subnet.source.cidr_block] | ||
protocols = ["tcp"] | ||
} | ||
} | ||
destination = { | ||
resource_statement = { | ||
resource_types = [ | ||
"AWS::EC2::Instance" | ||
] | ||
} | ||
packet_header_statement = { | ||
destination_addresses = [aws_subnet.dest.cidr_block] | ||
protocols = ["tcp"] | ||
} | ||
} | ||
}] | ||
|
||
tags = [{ | ||
key = "Name" | ||
value = "source-ec2-tcp-to-dest-ec2-tcp" | ||
}] | ||
} |
42 changes: 42 additions & 0 deletions
42
...work_insights_access_scope/source_resourcetype_ec2_to_dest_resourcetype_ec2_exc_tgwatt.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,42 @@ | ||
resource "awscc_ec2_network_insights_access_scope" "example" { | ||
match_paths = [{ | ||
source = { | ||
resource_statement = { | ||
resource_types = [ | ||
"AWS::EC2::Instance" | ||
] | ||
} | ||
packet_header_statement = { | ||
source_addresses = [aws_subnet.source.cidr_block] | ||
protocols = ["tcp"] | ||
} | ||
} | ||
destination = { | ||
resource_statement = { | ||
resource_types = [ | ||
"AWS::EC2::Instance" | ||
] | ||
} | ||
packet_header_statement = { | ||
destination_addresses = [aws_subnet.dest.cidr_block] | ||
protocols = ["tcp"] | ||
destination_ports = [80] | ||
} | ||
} | ||
}] | ||
|
||
exclude_paths = [{ | ||
through_resources = [{ | ||
resource_statement = { | ||
resource_types = [ | ||
"AWS::EC2::TransitGatewayAttachment" | ||
] | ||
} | ||
}] | ||
}] | ||
|
||
tags = [{ | ||
key = "Name" | ||
value = "source-ec2-tcp-to-dest-ec2-tcp-exc-tgw-att" | ||
}] | ||
} |
41 changes: 41 additions & 0 deletions
41
templates/resources/ec2_network_insights_access_scope.md.tmpl
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,41 @@ | ||
--- | ||
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" | ||
subcategory: "" | ||
description: |- | ||
{{ .Description | plainmarkdown | trimspace | prefixlines " " }} | ||
--- | ||
|
||
# {{.Name}} ({{.Type}}) | ||
|
||
{{ .Description | trimspace }} | ||
|
||
## Example Usage | ||
|
||
### With `resources` and `resource_types` within `match_paths` | ||
|
||
Paths from a specific VPC by specifying its ID to any Internet Gateway. | ||
|
||
{{ tffile (printf "examples/resources/%s/source_resource_vpc_to_dest_resourcetype_igw.tf" .Name)}} | ||
|
||
### With `packet_header_statement` | ||
|
||
From an EC2 instance within a specified subnet CIDR range to an EC2 instance within a specified destination subnet CIDR range on TCP. | ||
|
||
{{ tffile (printf "examples/resources/%s/source_resourcetype_ec2_to_dest_resourcetype_ec2.tf" .Name)}} | ||
|
||
### With `exclude_paths` | ||
|
||
From an EC2 instance within a specified subnet CIDR range to an EC2 instance within a specified destination subnet CIDR range on TCP port 80. Excludes paths that have a Transit Gateway Attachment. | ||
|
||
{{ tffile (printf "examples/resources/%s/source_resourcetype_ec2_to_dest_resourcetype_ec2_exc_tgwatt.tf" .Name)}} | ||
|
||
{{ .SchemaMarkdown | trimspace }} | ||
{{- if .HasImport }} | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
{{ codefile "shell" .ImportFile }} | ||
|
||
{{- end }} |