-
Notifications
You must be signed in to change notification settings - Fork 1.3k
chore: Generate output type in metadata for network #650
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| apiVersion: blueprints.cloud.google.com/v1alpha1 | ||
| kind: BlueprintMetadata | ||
| metadata: | ||
|
|
@@ -296,34 +295,106 @@ spec: | |
| outputs: | ||
| - name: network | ||
| description: The created network | ||
| type: | ||
| - object | ||
| - network: | ||
| - object | ||
| - auto_create_subnetworks: bool | ||
| bgp_always_compare_med: bool | ||
| bgp_best_path_selection_mode: string | ||
| bgp_inter_region_cost: string | ||
| delete_default_routes_on_create: bool | ||
| description: string | ||
| enable_ula_internal_ipv6: bool | ||
| gateway_ipv4: string | ||
| id: string | ||
| internal_ipv6_range: string | ||
| mtu: number | ||
| name: string | ||
| network_firewall_policy_enforcement_order: string | ||
| network_id: string | ||
| network_profile: string | ||
| numeric_id: string | ||
| params: | ||
| - list | ||
| - - object | ||
| - resource_manager_tags: | ||
| - map | ||
| - string | ||
| project: string | ||
| routing_mode: string | ||
| self_link: string | ||
| timeouts: | ||
| - object | ||
| - create: string | ||
| delete: string | ||
| update: string | ||
| network_id: string | ||
| network_name: string | ||
| network_self_link: string | ||
| project_id: string | ||
| - name: network_id | ||
| description: The ID of the VPC being created | ||
| type: string | ||
| - name: network_name | ||
| description: The name of the VPC being created | ||
| type: string | ||
| - name: network_self_link | ||
| description: The URI of the VPC being created | ||
| type: string | ||
| - name: project_id | ||
| description: VPC project id | ||
| type: string | ||
| - name: route_names | ||
| description: The route names associated with this VPC | ||
| type: | ||
| - tuple | ||
| - [] | ||
| - name: subnets | ||
| description: A map with keys of form subnet_region/subnet_name and values being the outputs of the google_compute_subnetwork resources used to create corresponding subnets. | ||
| type: | ||
| - object | ||
| - {} | ||
| - name: subnets_flow_logs | ||
| description: Whether the subnets will have VPC flow logs enabled | ||
| type: | ||
| - tuple | ||
| - [] | ||
| - name: subnets_ids | ||
| description: The IDs of the subnets being created | ||
| type: | ||
| - tuple | ||
| - [] | ||
| - name: subnets_ips | ||
| description: The IPs and CIDRs of the subnets being created | ||
| type: | ||
| - tuple | ||
| - [] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are empty values in type added for some output types like subnets, subnets_flow_logs etc
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For fields you mentioned, it is possible to create a network without any subnets/subnet_flow_logs being set. Setting an emtpy list implies it can be empty. Would you recommend changing it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No changes needed if its autogenerated by |
||
| - name: subnets_names | ||
| description: The names of the subnets being created | ||
| type: | ||
| - tuple | ||
| - [] | ||
| - name: subnets_private_access | ||
| description: Whether the subnets will have access to Google API's without a public IP | ||
| type: | ||
| - tuple | ||
| - [] | ||
| - name: subnets_regions | ||
| description: The region where the subnets will be created | ||
| type: | ||
| - tuple | ||
| - [] | ||
| - name: subnets_secondary_ranges | ||
| description: The secondary ranges associated with these subnets | ||
| type: | ||
| - tuple | ||
| - [] | ||
| - name: subnets_self_links | ||
| description: The self-links of subnets being created | ||
| type: | ||
| - tuple | ||
| - [] | ||
| requirements: | ||
| roles: | ||
| - level: Project | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could u confirm where the fields and types of network output are checked from? from /outputs.tf
output "network" {
value = module.vpc
description = "The created network"
}
and module.vpc point to
modules/vpc/outputs.tf:
output "network" {
value = google_compute_network.network
description = "The VPC resource being created"
}
and some fields here are not present in resource "google_compute_network" "network" { ...} at modules/vpc/main.tf like gateway_ipv4
are these fields of network output type verified from terraform apply results of this module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, Ayushi! These changes were generated as part of the
cft blueprint metadata --generate-output-typecommand. It has been verified with the terraform apply result. A sample output of terraform apply looks like this:network_object = {
"network" = {
"auto_create_subnetworks" = false
"bgp_always_compare_med" = false
"bgp_best_path_selection_mode" = "LEGACY"
"bgp_inter_region_cost" = ""
"delete_default_routes_on_create" = false
"description" = ""
"enable_ula_internal_ipv6" = false
"gateway_ipv4" = ""
"id" = "projects/krushita-arcusdev-iam-test/global/networks/network-verification-test"
"internal_ipv6_range" = ""
"mtu" = 0
"name" = "network-verification-test"
"network_firewall_policy_enforcement_order" = "AFTER_CLASSIC_FIREWALL"
"network_id" = "5484640976277957679"
"network_profile" = ""
"numeric_id" = "5484640976277957679"
"params" = tolist([])
"project" = "krushita-arcusdev-iam-test"
"routing_mode" = "GLOBAL"
"self_link" = "https://www.googleapis.com/compute/v1/projects/krushita-arcusdev-iam-test/global/networks/network-verification-test"
"timeouts" = null /* object */
}
"network_id" = "projects/krushita-arcusdev-iam-test/global/networks/network-verification-test"
"network_name" = "network-verification-test"
"network_self_link" = "https://www.googleapis.com/compute/v1/projects/krushita-arcusdev-iam-test/global/networks/network-verification-test"
"project_id" = "krushita-arcusdev-iam-test"
}