From c706d959496d1168ffa7ff2b06a2ab6041b9dd09 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Wed, 19 Jul 2023 19:58:52 +0200 Subject: [PATCH] cdkft: use reusable workflow and translate more (#32457) * cdkft: use reusable workflow and translate more * fix: ignore cdktf markdown docs Due to the partial translation there might be missing links. The registry UI handles them gracefully so it's not a real problem * chore: add instance documentation to translated docs * cdktf: update r/lambda_alias.html.markdown,r/instance.html.markdown,r/eks_node_group.html.markdown,r/eks_identity_provider_config.html.markdown,r/eks_fargate_profile.html.markdown,r/eks_cluster.html.markdown,r/eks_addon.html.markdown,r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown,r/ec2_transit_gateway_vpc_attachment.html.markdown,r/ec2_transit_gateway_route_table_propagation.html.markdown --------- Co-authored-by: team-tf-cdk --- .github/workflows/cdktf-documentation.yml | 55 +- .github/workflows/website.yml | 4 +- .../d/ec2_client_vpn_endpoint.html.markdown | 34 +- .../python/d/ec2_coip_pool.html.markdown | 28 +- .../python/d/ec2_coip_pools.html.markdown | 28 +- .../cdktf/python/d/ec2_host.html.markdown | 39 +- .../python/d/ec2_instance_type.html.markdown | 19 +- .../ec2_instance_type_offering.html.markdown | 19 +- .../ec2_instance_type_offerings.html.markdown | 19 +- .../python/d/ec2_instance_types.html.markdown | 19 +- .../python/d/ec2_local_gateway.html.markdown | 21 +- ...c2_local_gateway_route_table.html.markdown | 21 +- ...2_local_gateway_route_tables.html.markdown | 24 +- ...al_gateway_virtual_interface.html.markdown | 32 +- ...eway_virtual_interface_group.html.markdown | 23 +- ...way_virtual_interface_groups.html.markdown | 19 +- .../python/d/ec2_local_gateways.html.markdown | 24 +- .../d/ec2_managed_prefix_list.html.markdown | 39 +- .../d/ec2_managed_prefix_lists.html.markdown | 35 +- ...c2_network_insights_analysis.html.markdown | 23 +- .../d/ec2_network_insights_path.html.markdown | 23 +- .../d/ec2_public_ipv4_pool.html.markdown | 19 +- .../d/ec2_public_ipv4_pools.html.markdown | 34 +- .../d/ec2_serial_console_access.html.markdown | 19 +- .../python/d/ec2_spot_price.html.markdown | 19 +- .../d/ec2_transit_gateway.html.markdown | 34 +- ...2_transit_gateway_attachment.html.markdown | 38 +- ..._transit_gateway_attachments.html.markdown | 54 +- .../ec2_transit_gateway_connect.html.markdown | 34 +- ...transit_gateway_connect_peer.html.markdown | 36 +- ...ateway_dx_gateway_attachment.html.markdown | 25 +- ...sit_gateway_multicast_domain.html.markdown | 34 +- ...t_gateway_peering_attachment.html.markdown | 34 +- ..._transit_gateway_route_table.html.markdown | 34 +- ...way_route_table_associations.html.markdown | 23 +- ...way_route_table_propagations.html.markdown | 23 +- ...transit_gateway_route_tables.html.markdown | 28 +- ...ansit_gateway_vpc_attachment.html.markdown | 34 +- ...nsit_gateway_vpc_attachments.html.markdown | 33 +- ...ansit_gateway_vpn_attachment.html.markdown | 40 +- .../cdktf/python/d/eks_addon.html.markdown | 57 ++ .../python/d/eks_addon_version.html.markdown | 70 +++ .../cdktf/python/d/eks_cluster.html.markdown | 83 +++ .../python/d/eks_cluster_auth.html.markdown | 66 +++ .../cdktf/python/d/eks_clusters.html.markdown | 50 ++ .../python/d/eks_node_group.html.markdown | 75 +++ .../python/d/eks_node_groups.html.markdown | 57 ++ .../cdktf/python/d/lambda_alias.html.markdown | 51 ++ .../lambda_code_signing_config.html.markdown | 62 +++ .../python/d/lambda_function.html.markdown | 79 +++ .../d/lambda_function_url.html.markdown | 59 ++ .../python/d/lambda_functions.html.markdown | 43 ++ .../python/d/lambda_invocation.html.markdown | 54 ++ .../d/lambda_layer_version.html.markdown | 68 +++ website/docs/cdktf/python/d/vpc.html.markdown | 116 ++++ .../python/d/vpc_dhcp_options.html.markdown | 93 ++++ .../cdktf/python/d/vpc_endpoint.html.markdown | 91 +++ .../d/vpc_endpoint_service.html.markdown | 131 +++++ .../python/d/vpc_ipam_pool.html.markdown | 101 ++++ .../d/vpc_ipam_pool_cidrs.html.markdown | 121 ++++ .../python/d/vpc_ipam_pools.html.markdown | 83 +++ .../vpc_ipam_preview_next_cidr.html.markdown | 72 +++ .../d/vpc_peering_connection.html.markdown | 114 ++++ .../d/vpc_peering_connections.html.markdown | 83 +++ .../d/vpc_security_group_rule.html.markdown | 67 +++ .../d/vpc_security_group_rules.html.markdown | 56 ++ .../d/vpclattice_auth_policy.html.markdown | 49 ++ .../d/vpclattice_listener.html.markdown | 60 ++ .../vpclattice_resource_policy.html.markdown | 48 ++ .../python/d/vpclattice_service.html.markdown | 55 ++ .../vpclattice_service_network.html.markdown | 55 ++ .../docs/cdktf/python/d/vpcs.html.markdown | 119 ++++ .../ec2_availability_zone_group.html.markdown | 19 +- .../r/ec2_capacity_reservation.html.markdown | 19 +- .../r/ec2_carrier_gateway.html.markdown | 30 +- ...lient_vpn_authorization_rule.html.markdown | 27 +- .../r/ec2_client_vpn_endpoint.html.markdown | 48 +- ...ient_vpn_network_association.html.markdown | 25 +- .../r/ec2_client_vpn_route.html.markdown | 71 ++- .../cdktf/python/r/ec2_fleet.html.markdown | 87 +-- .../cdktf/python/r/ec2_host.html.markdown | 19 +- .../python/r/ec2_instance_state.html.markdown | 29 +- .../r/ec2_local_gateway_route.html.markdown | 27 +- ..._route_table_vpc_association.html.markdown | 29 +- .../r/ec2_managed_prefix_list.html.markdown | 52 +- ...c2_managed_prefix_list_entry.html.markdown | 46 +- ...c2_network_insights_analysis.html.markdown | 35 +- .../r/ec2_network_insights_path.html.markdown | 27 +- .../r/ec2_serial_console_access.html.markdown | 19 +- .../ec2_subnet_cidr_reservation.html.markdown | 27 +- .../docs/cdktf/python/r/ec2_tag.html.markdown | 39 +- .../r/ec2_traffic_mirror_filter.html.markdown | 19 +- ...2_traffic_mirror_filter_rule.html.markdown | 29 +- .../ec2_traffic_mirror_session.html.markdown | 49 +- .../r/ec2_traffic_mirror_target.html.markdown | 43 +- .../r/ec2_transit_gateway.html.markdown | 19 +- .../ec2_transit_gateway_connect.html.markdown | 37 +- ...transit_gateway_connect_peer.html.markdown | 42 +- ...sit_gateway_multicast_domain.html.markdown | 155 +++--- ...multicast_domain_association.html.markdown | 64 ++- ...teway_multicast_group_member.html.markdown | 27 +- ...teway_multicast_group_source.html.markdown | 27 +- ...t_gateway_peering_attachment.html.markdown | 48 +- ..._peering_attachment_accepter.html.markdown | 30 +- ...transit_gateway_policy_table.html.markdown | 30 +- ...way_policy_table_association.html.markdown | 25 +- ...ateway_prefix_list_reference.html.markdown | 50 +- .../r/ec2_transit_gateway_route.html.markdown | 50 +- ..._transit_gateway_route_table.html.markdown | 23 +- ...eway_route_table_association.html.markdown | 26 +- ...eway_route_table_propagation.html.markdown | 25 +- ...ansit_gateway_vpc_attachment.html.markdown | 27 +- ...eway_vpc_attachment_accepter.html.markdown | 30 +- .../cdktf/python/r/eks_addon.html.markdown | 247 ++++++++ .../cdktf/python/r/eks_cluster.html.markdown | 367 ++++++++++++ .../r/eks_fargate_profile.html.markdown | 125 +++++ ...eks_identity_provider_config.html.markdown | 82 +++ .../python/r/eks_node_group.html.markdown | 278 +++++++++ .../cdktf/python/r/instance.html.markdown | 505 +++++++++++++++++ .../cdktf/python/r/lambda_alias.html.markdown | 76 +++ .../lambda_code_signing_config.html.markdown | 74 +++ .../lambda_event_source_mapping.html.markdown | 326 +++++++++++ .../python/r/lambda_function.html.markdown | 418 ++++++++++++++ ...function_event_invoke_config.html.markdown | 195 +++++++ .../r/lambda_function_url.html.markdown | 85 +++ .../python/r/lambda_invocation.html.markdown | 175 ++++++ .../r/lambda_layer_version.html.markdown | 97 ++++ ...bda_layer_version_permission.html.markdown | 72 +++ .../python/r/lambda_permission.html.markdown | 322 +++++++++++ ...ovisioned_concurrency_config.html.markdown | 94 ++++ website/docs/cdktf/python/r/vpc.html.markdown | 153 +++++ .../python/r/vpc_dhcp_options.html.markdown | 101 ++++ ...vpc_dhcp_options_association.html.markdown | 61 ++ .../cdktf/python/r/vpc_endpoint.html.markdown | 228 ++++++++ ...endpoint_connection_accepter.html.markdown | 78 +++ ...oint_connection_notification.html.markdown | 93 ++++ .../r/vpc_endpoint_policy.html.markdown | 88 +++ ...oint_route_table_association.html.markdown | 57 ++ ...t_security_group_association.html.markdown | 57 ++ .../r/vpc_endpoint_service.html.markdown | 103 ++++ ...nt_service_allowed_principal.html.markdown | 58 ++ ..._endpoint_subnet_association.html.markdown | 72 +++ .../cdktf/python/r/vpc_ipam.html.markdown | 118 ++++ ...m_organization_admin_account.html.markdown | 68 +++ .../python/r/vpc_ipam_pool.html.markdown | 130 +++++ .../python/r/vpc_ipam_pool_cidr.html.markdown | 134 +++++ ...pc_ipam_pool_cidr_allocation.html.markdown | 139 +++++ .../vpc_ipam_preview_next_cidr.html.markdown | 80 +++ .../vpc_ipam_resource_discovery.html.markdown | 76 +++ ...source_discovery_association.html.markdown | 71 +++ .../python/r/vpc_ipam_scope.html.markdown | 75 +++ ..._ipv4_cidr_block_association.html.markdown | 72 +++ ..._ipv6_cidr_block_association.html.markdown | 73 +++ ...formance_metric_subscription.html.markdown | 50 ++ .../r/vpc_peering_connection.html.markdown | 206 +++++++ ..._peering_connection_accepter.html.markdown | 152 +++++ ...c_peering_connection_options.html.markdown | 174 ++++++ ...c_security_group_egress_rule.html.markdown | 76 +++ ..._security_group_ingress_rule.html.markdown | 76 +++ ...tice_access_log_subscription.html.markdown | 62 +++ .../r/vpclattice_auth_policy.html.markdown | 90 +++ .../r/vpclattice_listener.html.markdown | 198 +++++++ .../r/vpclattice_listener_rule.html.markdown | 190 +++++++ .../vpclattice_resource_policy.html.markdown | 82 +++ .../python/r/vpclattice_service.html.markdown | 76 +++ .../vpclattice_service_network.html.markdown | 63 +++ ..._network_service_association.html.markdown | 76 +++ ...vice_network_vpc_association.html.markdown | 74 +++ .../r/vpclattice_target_group.html.markdown | 163 ++++++ ...tice_target_group_attachment.html.markdown | 56 ++ .../d/ec2_client_vpn_endpoint.html.markdown | 68 +-- .../typescript/d/ec2_coip_pool.html.markdown | 29 +- .../typescript/d/ec2_coip_pools.html.markdown | 29 +- .../cdktf/typescript/d/ec2_host.html.markdown | 53 +- .../d/ec2_instance_type.html.markdown | 23 +- .../ec2_instance_type_offering.html.markdown | 43 +- .../ec2_instance_type_offerings.html.markdown | 51 +- .../d/ec2_instance_types.html.markdown | 23 +- .../d/ec2_local_gateway.html.markdown | 29 +- ...c2_local_gateway_route_table.html.markdown | 33 +- ...2_local_gateway_route_tables.html.markdown | 32 +- ...al_gateway_virtual_interface.html.markdown | 36 +- ...eway_virtual_interface_group.html.markdown | 24 +- ...way_virtual_interface_groups.html.markdown | 27 +- .../d/ec2_local_gateways.html.markdown | 36 +- .../d/ec2_managed_prefix_list.html.markdown | 75 ++- .../d/ec2_managed_prefix_lists.html.markdown | 71 +-- ...c2_network_insights_analysis.html.markdown | 26 +- .../d/ec2_network_insights_path.html.markdown | 26 +- .../d/ec2_public_ipv4_pool.html.markdown | 23 +- .../d/ec2_public_ipv4_pools.html.markdown | 64 +-- .../d/ec2_serial_console_access.html.markdown | 27 +- .../typescript/d/ec2_spot_price.html.markdown | 23 +- .../d/ec2_transit_gateway.html.markdown | 42 +- ...2_transit_gateway_attachment.html.markdown | 39 +- ..._transit_gateway_attachments.html.markdown | 60 +- .../ec2_transit_gateway_connect.html.markdown | 68 +-- ...transit_gateway_connect_peer.html.markdown | 70 +-- ...ateway_dx_gateway_attachment.html.markdown | 26 +- ...sit_gateway_multicast_domain.html.markdown | 68 +-- ...t_gateway_peering_attachment.html.markdown | 68 +-- ..._transit_gateway_route_table.html.markdown | 76 +-- ...way_route_table_associations.html.markdown | 26 +- ...way_route_table_propagations.html.markdown | 26 +- ...transit_gateway_route_tables.html.markdown | 33 +- ...ansit_gateway_vpc_attachment.html.markdown | 68 +-- ...nsit_gateway_vpc_attachments.html.markdown | 75 +-- ...ansit_gateway_vpn_attachment.html.markdown | 63 ++- .../typescript/d/eks_addon.html.markdown | 60 ++ .../d/eks_addon_version.html.markdown | 73 +++ .../typescript/d/eks_cluster.html.markdown | 86 +++ .../d/eks_cluster_auth.html.markdown | 75 +++ .../typescript/d/eks_clusters.html.markdown | 54 ++ .../typescript/d/eks_node_group.html.markdown | 78 +++ .../d/eks_node_groups.html.markdown | 65 +++ .../typescript/d/lambda_alias.html.markdown | 54 ++ .../lambda_code_signing_config.html.markdown | 70 +++ .../d/lambda_function.html.markdown | 82 +++ .../d/lambda_function_url.html.markdown | 62 +++ .../d/lambda_functions.html.markdown | 46 ++ .../d/lambda_invocation.html.markdown | 64 +++ .../d/lambda_layer_version.html.markdown | 71 +++ .../docs/cdktf/typescript/d/vpc.html.markdown | 120 ++++ .../d/vpc_dhcp_options.html.markdown | 101 ++++ .../typescript/d/vpc_endpoint.html.markdown | 94 ++++ .../d/vpc_endpoint_service.html.markdown | 141 +++++ .../typescript/d/vpc_ipam_pool.html.markdown | 106 ++++ .../d/vpc_ipam_pool_cidrs.html.markdown | 134 +++++ .../typescript/d/vpc_ipam_pools.html.markdown | 88 +++ .../vpc_ipam_preview_next_cidr.html.markdown | 78 +++ .../d/vpc_peering_connection.html.markdown | 117 ++++ .../d/vpc_peering_connections.html.markdown | 93 ++++ .../d/vpc_security_group_rule.html.markdown | 70 +++ .../d/vpc_security_group_rules.html.markdown | 60 ++ .../d/vpclattice_auth_policy.html.markdown | 54 ++ .../d/vpclattice_listener.html.markdown | 67 +++ .../vpclattice_resource_policy.html.markdown | 51 ++ .../d/vpclattice_service.html.markdown | 61 ++ .../vpclattice_service_network.html.markdown | 58 ++ .../cdktf/typescript/d/vpcs.html.markdown | 136 +++++ .../ec2_availability_zone_group.html.markdown | 23 +- .../r/ec2_capacity_reservation.html.markdown | 23 +- .../r/ec2_carrier_gateway.html.markdown | 29 +- ...lient_vpn_authorization_rule.html.markdown | 28 +- .../r/ec2_client_vpn_endpoint.html.markdown | 48 +- ...ient_vpn_network_association.html.markdown | 26 +- .../r/ec2_client_vpn_route.html.markdown | 77 ++- .../typescript/r/ec2_fleet.html.markdown | 92 ++- .../cdktf/typescript/r/ec2_host.html.markdown | 23 +- .../r/ec2_instance_state.html.markdown | 41 +- .../r/ec2_local_gateway_route.html.markdown | 32 +- ..._route_table_vpc_association.html.markdown | 53 +- .../r/ec2_managed_prefix_list.html.markdown | 53 +- ...c2_managed_prefix_list_entry.html.markdown | 43 +- ...c2_network_insights_analysis.html.markdown | 34 +- .../r/ec2_network_insights_path.html.markdown | 28 +- .../r/ec2_serial_console_access.html.markdown | 23 +- .../ec2_subnet_cidr_reservation.html.markdown | 28 +- .../cdktf/typescript/r/ec2_tag.html.markdown | 59 +- .../r/ec2_traffic_mirror_filter.html.markdown | 23 +- ...2_traffic_mirror_filter_rule.html.markdown | 97 ++-- .../ec2_traffic_mirror_session.html.markdown | 48 +- .../r/ec2_traffic_mirror_target.html.markdown | 42 +- .../r/ec2_transit_gateway.html.markdown | 23 +- .../ec2_transit_gateway_connect.html.markdown | 36 +- ...transit_gateway_connect_peer.html.markdown | 43 +- ...sit_gateway_multicast_domain.html.markdown | 289 ++++------ ...multicast_domain_association.html.markdown | 69 ++- ...teway_multicast_group_member.html.markdown | 30 +- ...teway_multicast_group_source.html.markdown | 30 +- ...t_gateway_peering_attachment.html.markdown | 86 ++- ..._peering_attachment_accepter.html.markdown | 31 +- ...transit_gateway_policy_table.html.markdown | 29 +- ...way_policy_table_association.html.markdown | 30 +- ...ateway_prefix_list_reference.html.markdown | 58 +- .../r/ec2_transit_gateway_route.html.markdown | 58 +- ..._transit_gateway_route_table.html.markdown | 24 +- ...eway_route_table_association.html.markdown | 31 +- ...eway_route_table_propagation.html.markdown | 30 +- ...ansit_gateway_vpc_attachment.html.markdown | 28 +- ...eway_vpc_attachment_accepter.html.markdown | 31 +- .../typescript/r/eks_addon.html.markdown | 292 ++++++++++ .../typescript/r/eks_cluster.html.markdown | 424 ++++++++++++++ .../r/eks_fargate_profile.html.markdown | 139 +++++ ...eks_identity_provider_config.html.markdown | 85 +++ .../typescript/r/eks_node_group.html.markdown | 329 +++++++++++ .../cdktf/typescript/r/instance.html.markdown | 527 ++++++++++++++++++ .../typescript/r/lambda_alias.html.markdown | 79 +++ .../lambda_code_signing_config.html.markdown | 77 +++ .../lambda_event_source_mapping.html.markdown | 360 ++++++++++++ .../r/lambda_function.html.markdown | 461 +++++++++++++++ ...function_event_invoke_config.html.markdown | 210 +++++++ .../r/lambda_function_url.html.markdown | 88 +++ .../r/lambda_invocation.html.markdown | 196 +++++++ .../r/lambda_layer_version.html.markdown | 100 ++++ ...bda_layer_version_permission.html.markdown | 75 +++ .../r/lambda_permission.html.markdown | 345 ++++++++++++ ...ovisioned_concurrency_config.html.markdown | 100 ++++ .../docs/cdktf/typescript/r/vpc.html.markdown | 163 ++++++ .../r/vpc_dhcp_options.html.markdown | 107 ++++ ...vpc_dhcp_options_association.html.markdown | 64 +++ .../typescript/r/vpc_endpoint.html.markdown | 248 +++++++++ ...endpoint_connection_accepter.html.markdown | 85 +++ ...oint_connection_notification.html.markdown | 98 ++++ .../r/vpc_endpoint_policy.html.markdown | 101 ++++ ...oint_route_table_association.html.markdown | 60 ++ ...t_security_group_association.html.markdown | 60 ++ .../r/vpc_endpoint_service.html.markdown | 109 ++++ ...nt_service_allowed_principal.html.markdown | 61 ++ ..._endpoint_subnet_association.html.markdown | 75 +++ .../cdktf/typescript/r/vpc_ipam.html.markdown | 134 +++++ ...m_organization_admin_account.html.markdown | 71 +++ .../typescript/r/vpc_ipam_pool.html.markdown | 138 +++++ .../r/vpc_ipam_pool_cidr.html.markdown | 146 +++++ ...pc_ipam_pool_cidr_allocation.html.markdown | 155 ++++++ .../vpc_ipam_preview_next_cidr.html.markdown | 88 +++ .../vpc_ipam_resource_discovery.html.markdown | 80 +++ ...source_discovery_association.html.markdown | 76 +++ .../typescript/r/vpc_ipam_scope.html.markdown | 79 +++ ..._ipv4_cidr_block_association.html.markdown | 75 +++ ..._ipv6_cidr_block_association.html.markdown | 80 +++ ...formance_metric_subscription.html.markdown | 53 ++ .../r/vpc_peering_connection.html.markdown | 218 ++++++++ ..._peering_connection_accepter.html.markdown | 168 ++++++ ...c_peering_connection_options.html.markdown | 196 +++++++ ...c_security_group_egress_rule.html.markdown | 79 +++ ..._security_group_ingress_rule.html.markdown | 79 +++ ...tice_access_log_subscription.html.markdown | 65 +++ .../r/vpclattice_auth_policy.html.markdown | 99 ++++ .../r/vpclattice_listener.html.markdown | 213 +++++++ .../r/vpclattice_listener_rule.html.markdown | 201 +++++++ .../vpclattice_resource_policy.html.markdown | 99 ++++ .../r/vpclattice_service.html.markdown | 79 +++ .../vpclattice_service_network.html.markdown | 66 +++ ..._network_service_association.html.markdown | 81 +++ ...vice_network_vpc_association.html.markdown | 79 +++ .../r/vpclattice_target_group.html.markdown | 172 ++++++ ...tice_target_group_attachment.html.markdown | 59 ++ 338 files changed, 24751 insertions(+), 2340 deletions(-) create mode 100644 website/docs/cdktf/python/d/eks_addon.html.markdown create mode 100644 website/docs/cdktf/python/d/eks_addon_version.html.markdown create mode 100644 website/docs/cdktf/python/d/eks_cluster.html.markdown create mode 100644 website/docs/cdktf/python/d/eks_cluster_auth.html.markdown create mode 100644 website/docs/cdktf/python/d/eks_clusters.html.markdown create mode 100644 website/docs/cdktf/python/d/eks_node_group.html.markdown create mode 100644 website/docs/cdktf/python/d/eks_node_groups.html.markdown create mode 100644 website/docs/cdktf/python/d/lambda_alias.html.markdown create mode 100644 website/docs/cdktf/python/d/lambda_code_signing_config.html.markdown create mode 100644 website/docs/cdktf/python/d/lambda_function.html.markdown create mode 100644 website/docs/cdktf/python/d/lambda_function_url.html.markdown create mode 100644 website/docs/cdktf/python/d/lambda_functions.html.markdown create mode 100644 website/docs/cdktf/python/d/lambda_invocation.html.markdown create mode 100644 website/docs/cdktf/python/d/lambda_layer_version.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_dhcp_options.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_endpoint.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_endpoint_service.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_ipam_pool.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_ipam_pool_cidrs.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_ipam_pools.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_ipam_preview_next_cidr.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_peering_connection.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_peering_connections.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_security_group_rule.html.markdown create mode 100644 website/docs/cdktf/python/d/vpc_security_group_rules.html.markdown create mode 100644 website/docs/cdktf/python/d/vpclattice_auth_policy.html.markdown create mode 100644 website/docs/cdktf/python/d/vpclattice_listener.html.markdown create mode 100644 website/docs/cdktf/python/d/vpclattice_resource_policy.html.markdown create mode 100644 website/docs/cdktf/python/d/vpclattice_service.html.markdown create mode 100644 website/docs/cdktf/python/d/vpclattice_service_network.html.markdown create mode 100644 website/docs/cdktf/python/d/vpcs.html.markdown create mode 100644 website/docs/cdktf/python/r/eks_addon.html.markdown create mode 100644 website/docs/cdktf/python/r/eks_cluster.html.markdown create mode 100644 website/docs/cdktf/python/r/eks_fargate_profile.html.markdown create mode 100644 website/docs/cdktf/python/r/eks_identity_provider_config.html.markdown create mode 100644 website/docs/cdktf/python/r/eks_node_group.html.markdown create mode 100644 website/docs/cdktf/python/r/instance.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_alias.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_code_signing_config.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_event_source_mapping.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_function.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_function_event_invoke_config.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_function_url.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_invocation.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_layer_version.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_layer_version_permission.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_permission.html.markdown create mode 100644 website/docs/cdktf/python/r/lambda_provisioned_concurrency_config.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_dhcp_options.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_dhcp_options_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint_connection_accepter.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint_connection_notification.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint_policy.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint_route_table_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint_security_group_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint_service.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint_service_allowed_principal.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_endpoint_subnet_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam_organization_admin_account.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam_pool.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam_pool_cidr.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam_pool_cidr_allocation.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam_preview_next_cidr.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam_resource_discovery.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam_resource_discovery_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipam_scope.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipv4_cidr_block_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_ipv6_cidr_block_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_network_performance_metric_subscription.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_peering_connection.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_peering_connection_accepter.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_peering_connection_options.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_security_group_egress_rule.html.markdown create mode 100644 website/docs/cdktf/python/r/vpc_security_group_ingress_rule.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_access_log_subscription.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_auth_policy.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_listener.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_listener_rule.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_resource_policy.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_service.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_service_network.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_service_network_service_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_service_network_vpc_association.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_target_group.html.markdown create mode 100644 website/docs/cdktf/python/r/vpclattice_target_group_attachment.html.markdown create mode 100644 website/docs/cdktf/typescript/d/eks_addon.html.markdown create mode 100644 website/docs/cdktf/typescript/d/eks_addon_version.html.markdown create mode 100644 website/docs/cdktf/typescript/d/eks_cluster.html.markdown create mode 100644 website/docs/cdktf/typescript/d/eks_cluster_auth.html.markdown create mode 100644 website/docs/cdktf/typescript/d/eks_clusters.html.markdown create mode 100644 website/docs/cdktf/typescript/d/eks_node_group.html.markdown create mode 100644 website/docs/cdktf/typescript/d/eks_node_groups.html.markdown create mode 100644 website/docs/cdktf/typescript/d/lambda_alias.html.markdown create mode 100644 website/docs/cdktf/typescript/d/lambda_code_signing_config.html.markdown create mode 100644 website/docs/cdktf/typescript/d/lambda_function.html.markdown create mode 100644 website/docs/cdktf/typescript/d/lambda_function_url.html.markdown create mode 100644 website/docs/cdktf/typescript/d/lambda_functions.html.markdown create mode 100644 website/docs/cdktf/typescript/d/lambda_invocation.html.markdown create mode 100644 website/docs/cdktf/typescript/d/lambda_layer_version.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_dhcp_options.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_endpoint.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_endpoint_service.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_ipam_pool.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_ipam_pool_cidrs.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_ipam_pools.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_ipam_preview_next_cidr.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_peering_connection.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_peering_connections.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_security_group_rule.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpc_security_group_rules.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpclattice_auth_policy.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpclattice_listener.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpclattice_resource_policy.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpclattice_service.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpclattice_service_network.html.markdown create mode 100644 website/docs/cdktf/typescript/d/vpcs.html.markdown create mode 100644 website/docs/cdktf/typescript/r/eks_addon.html.markdown create mode 100644 website/docs/cdktf/typescript/r/eks_cluster.html.markdown create mode 100644 website/docs/cdktf/typescript/r/eks_fargate_profile.html.markdown create mode 100644 website/docs/cdktf/typescript/r/eks_identity_provider_config.html.markdown create mode 100644 website/docs/cdktf/typescript/r/eks_node_group.html.markdown create mode 100644 website/docs/cdktf/typescript/r/instance.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_alias.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_code_signing_config.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_event_source_mapping.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_function.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_function_event_invoke_config.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_function_url.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_invocation.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_layer_version.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_layer_version_permission.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_permission.html.markdown create mode 100644 website/docs/cdktf/typescript/r/lambda_provisioned_concurrency_config.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_dhcp_options.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_dhcp_options_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint_connection_accepter.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint_connection_notification.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint_policy.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint_route_table_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint_security_group_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint_service.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint_service_allowed_principal.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_endpoint_subnet_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam_organization_admin_account.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam_pool.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam_pool_cidr.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam_pool_cidr_allocation.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam_preview_next_cidr.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam_resource_discovery.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam_resource_discovery_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipam_scope.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipv4_cidr_block_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_ipv6_cidr_block_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_network_performance_metric_subscription.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_peering_connection.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_peering_connection_accepter.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_peering_connection_options.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_security_group_egress_rule.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpc_security_group_ingress_rule.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_access_log_subscription.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_auth_policy.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_listener.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_listener_rule.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_resource_policy.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_service.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_service_network.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_service_network_service_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_service_network_vpc_association.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_target_group.html.markdown create mode 100644 website/docs/cdktf/typescript/r/vpclattice_target_group_attachment.html.markdown diff --git a/.github/workflows/cdktf-documentation.yml b/.github/workflows/cdktf-documentation.yml index a0e2302a0ca..73066ea1b38 100644 --- a/.github/workflows/cdktf-documentation.yml +++ b/.github/workflows/cdktf-documentation.yml @@ -10,48 +10,13 @@ permissions: jobs: cdktfDocs: - runs-on: - - custom - - linux - - custom-linux-medium - container: - image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform - env: - CHECKPOINT_DISABLE: "1" - timeout-minutes: 120 - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - run: git config --global user.email "github-team-tf-cdk@hashicorp.com" - - run: git config --global user.name "team-tf-cdk" - - name: Get yarn cache directory path - id: global-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - id: global-cache - with: - path: ${{ steps.global-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-integration-yarn-${{ hashFiles('**/yarn.lock') }} - - name: Setup Node.js - uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 - with: - node-version: "18.x" - - name: Install cdktf-registry-docs - run: npm install -g cdktf-registry-docs@1.12.0 - - name: Run conversion - run: | - cdktf-registry-docs convert \ - --files='*/ec2_*.html.markdown' \ - --languages='typescript,python' \ - --parallel-file-conversions=1 \ - --provider-from-registry="hashicorp/aws" \ - . - env: - TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins - - - name: Create Pull Request - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 - with: - commit-message: "docs: update cdktf documentation" - title: "docs: update cdktf documentation" - body: "This PR updates the cdktf related documentation based on the current HCL-based documentation. It is automatically created by the cdktf-documentation GitHub action." - token: ${{ secrets.ORGSCOPED_GITHUB_TOKEN }} + uses: hashicorp/terraform-cdk/.github/workflows/registry-docs-pr-based.yml@304e2507209c9657135dc7b4b7ee68030327468f + secrets: + GH_PR_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + providerFqn: "hashicorp/aws" + files: "*/ec2*.html.markdown,*/lambda*.html.markdown,*/eks*.html.markdown,*/vpc*.html.markdown,*/instance.html.markdown" + languages: "typescript,python" + parallelFileConversions: 1 + maxRunners: 20 + cdktfRegistryDocsVersion: "1.14.2" diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index f62746a3acb..85f204ba905 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -27,7 +27,7 @@ jobs: use-quiet-mode: "yes" use-verbose-mode: "yes" config-file: ".ci/.markdownlinkcheck.json" - folder-path: "website/docs" + folder-path: "website/docs/r, website/docs/d" file-prefix: "[a-h]" file-extension: ".markdown" base-branch: "main" @@ -43,7 +43,7 @@ jobs: use-quiet-mode: "yes" use-verbose-mode: "yes" config-file: ".ci/.markdownlinkcheck.json" - folder-path: "website/docs" + folder-path: "website/docs/r, website/docs/d" file-prefix: "[i-z]" file-extension: ".markdown" base-branch: "main" diff --git a/website/docs/cdktf/python/d/ec2_client_vpn_endpoint.html.markdown b/website/docs/cdktf/python/d/ec2_client_vpn_endpoint.html.markdown index 964c619ccc9..f9b4bd2ffb6 100644 --- a/website/docs/cdktf/python/d/ec2_client_vpn_endpoint.html.markdown +++ b/website/docs/cdktf/python/d/ec2_client_vpn_endpoint.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Client VPN endpoint --- + + # Data Source: aws_ec2_client_vpn_endpoint Get information on an EC2 Client VPN endpoint. @@ -15,15 +17,18 @@ Get information on an EC2 Client VPN endpoint. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_client_vpn_endpoint import DataAwsEc2ClientVpnEndpoint +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_client_vpn_endpoint.DataAwsEc2ClientVpnEndpoint(self, "example", + DataAwsEc2ClientVpnEndpoint(self, "example", filter=[DataAwsEc2ClientVpnEndpointFilter( name="tag:Name", values=["ExampleVpn"] @@ -35,15 +40,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### By Identifier ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_client_vpn_endpoint import DataAwsEc2ClientVpnEndpoint +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_client_vpn_endpoint.DataAwsEc2ClientVpnEndpoint(self, "example", + DataAwsEc2ClientVpnEndpoint(self, "example", client_vpn_endpoint_id="cvpn-endpoint-083cf50d6eb314f21" ) ``` @@ -93,4 +101,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_coip_pool.html.markdown b/website/docs/cdktf/python/d/ec2_coip_pool.html.markdown index 7e892b484f3..d80a5b69792 100644 --- a/website/docs/cdktf/python/d/ec2_coip_pool.html.markdown +++ b/website/docs/cdktf/python/d/ec2_coip_pool.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about a specific EC2 Customer-Owned IP Pool --- + + # Data Source: aws_ec2_coip_pool Provides details about a specific EC2 Customer-Owned IP Pool. @@ -18,12 +20,24 @@ COIP Pool. The following example returns a specific coip pool ID -```terraform -variable "coip_pool_id" {} - -data "aws_ec2_coip_pool" "selected" { - id = var.coip_pool_id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformVariable, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_coip_pool import DataAwsEc2CoipPool +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + # You can read more about this at https://cdk.tf/variables + coip_pool_id = TerraformVariable(self, "coip_pool_id") + DataAwsEc2CoipPool(self, "selected", + id=coip_pool_id.string_value + ) ``` ## Argument Reference @@ -66,4 +80,4 @@ In addition, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_coip_pools.html.markdown b/website/docs/cdktf/python/d/ec2_coip_pools.html.markdown index 26216a83d79..a648ee72362 100644 --- a/website/docs/cdktf/python/d/ec2_coip_pools.html.markdown +++ b/website/docs/cdktf/python/d/ec2_coip_pools.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Customer-Owned IP Pools --- + + # Data Source: aws_ec2_coip_pools Provides information for multiple EC2 Customer-Owned IP Pools, such as their identifiers. @@ -14,12 +16,24 @@ Provides information for multiple EC2 Customer-Owned IP Pools, such as their ide The following shows outputting all COIP Pool Ids. -```terraform -data "aws_ec2_coip_pools" "foo" {} - -output "foo" { - value = data.aws_ec2_coip_pools.foo.ids -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_coip_pools import DataAwsEc2CoipPools +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + foo = DataAwsEc2CoipPools(self, "foo") + cdktf_terraform_output_foo = TerraformOutput(self, "foo_1", + value=foo.ids + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + cdktf_terraform_output_foo.override_logical_id("foo") ``` ## Argument Reference @@ -49,4 +63,4 @@ which take the following arguments: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_host.html.markdown b/website/docs/cdktf/python/d/ec2_host.html.markdown index 7764d71aa1f..8f7d844e501 100644 --- a/website/docs/cdktf/python/d/ec2_host.html.markdown +++ b/website/docs/cdktf/python/d/ec2_host.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Host. --- + + # Data Source: aws_ec2_host Use this data source to get information about an EC2 Dedicated Host. @@ -13,20 +15,24 @@ Use this data source to get information about an EC2 Dedicated Host. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_host import DataAwsEc2Host +from imports.aws.ec2_host import Ec2Host +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws_ec2_host_test = aws.ec2_host.Ec2Host(self, "test", + test = Ec2Host(self, "test", availability_zone="us-west-2a", instance_type="c5.18xlarge" ) - data_aws_ec2_host_test = aws.data_aws_ec2_host.DataAwsEc2Host(self, "test_1", - host_id=cdktf.Token.as_string(aws_ec2_host_test.id) + data_aws_ec2_host_test = DataAwsEc2Host(self, "test_1", + host_id=test.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_aws_ec2_host_test.override_logical_id("test") @@ -35,15 +41,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### Filter Example ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_host import DataAwsEc2Host +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_host.DataAwsEc2Host(self, "test", + DataAwsEc2Host(self, "test", filter=[DataAwsEc2HostFilter( name="instance-type", values=["c5.18xlarge"] @@ -92,4 +101,4 @@ In addition to the attributes above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_instance_type.html.markdown b/website/docs/cdktf/python/d/ec2_instance_type.html.markdown index e0d9e62703d..940938462f8 100644 --- a/website/docs/cdktf/python/d/ec2_instance_type.html.markdown +++ b/website/docs/cdktf/python/d/ec2_instance_type.html.markdown @@ -7,6 +7,8 @@ description: |- --- + + # Data Source: aws_ec2_instance_type Get characteristics for a single EC2 Instance Type. @@ -14,15 +16,18 @@ Get characteristics for a single EC2 Instance Type. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_instance_type import DataAwsEc2InstanceType +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_instance_type.DataAwsEc2InstanceType(self, "example", + DataAwsEc2InstanceType(self, "example", instance_type="t2.micro" ) ``` @@ -105,4 +110,4 @@ In addition to the argument above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_instance_type_offering.html.markdown b/website/docs/cdktf/python/d/ec2_instance_type_offering.html.markdown index 95edfae440f..74cc3d3398a 100644 --- a/website/docs/cdktf/python/d/ec2_instance_type_offering.html.markdown +++ b/website/docs/cdktf/python/d/ec2_instance_type_offering.html.markdown @@ -6,6 +6,8 @@ description: |- Information about single EC2 Instance Type Offering. --- + + # Data Source: aws_ec2_instance_type_offering Information about single EC2 Instance Type Offering. @@ -13,15 +15,18 @@ Information about single EC2 Instance Type Offering. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_instance_type_offering import DataAwsEc2InstanceTypeOffering +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_instance_type_offering.DataAwsEc2InstanceTypeOffering(self, "example", + DataAwsEc2InstanceTypeOffering(self, "example", filter=[DataAwsEc2InstanceTypeOfferingFilter( name="instance-type", values=["t2.micro", "t3.micro"] @@ -57,4 +62,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_instance_type_offerings.html.markdown b/website/docs/cdktf/python/d/ec2_instance_type_offerings.html.markdown index 02bcc7bf2bb..e79129aba60 100644 --- a/website/docs/cdktf/python/d/ec2_instance_type_offerings.html.markdown +++ b/website/docs/cdktf/python/d/ec2_instance_type_offerings.html.markdown @@ -6,6 +6,8 @@ description: |- Information about EC2 Instance Type Offerings. --- + + # Data Source: aws_ec2_instance_type_offerings Information about EC2 Instance Type Offerings. @@ -13,15 +15,18 @@ Information about EC2 Instance Type Offerings. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_instance_type_offerings import DataAwsEc2InstanceTypeOfferings +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_instance_type_offerings.DataAwsEc2InstanceTypeOfferings(self, "example", + DataAwsEc2InstanceTypeOfferings(self, "example", filter=[DataAwsEc2InstanceTypeOfferingsFilter( name="instance-type", values=["t2.micro", "t3.micro"] @@ -63,4 +68,4 @@ Note that the indexes of Instance Type Offering instance types, locations and lo - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_instance_types.html.markdown b/website/docs/cdktf/python/d/ec2_instance_types.html.markdown index 4fcf7bedeb8..559505c5d33 100644 --- a/website/docs/cdktf/python/d/ec2_instance_types.html.markdown +++ b/website/docs/cdktf/python/d/ec2_instance_types.html.markdown @@ -6,6 +6,8 @@ description: |- Information about EC2 Instance Types. --- + + # Data Source: aws_ec2_instance_types Information about EC2 Instance Types. @@ -13,15 +15,18 @@ Information about EC2 Instance Types. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_instance_types import DataAwsEc2InstanceTypes +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_instance_types.DataAwsEc2InstanceTypes(self, "test", + DataAwsEc2InstanceTypes(self, "test", filter=[DataAwsEc2InstanceTypesFilter( name="auto-recovery-supported", values=["true"] @@ -63,4 +68,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_local_gateway.html.markdown b/website/docs/cdktf/python/d/ec2_local_gateway.html.markdown index cd328f6e6c0..2b1e3b556fa 100644 --- a/website/docs/cdktf/python/d/ec2_local_gateway.html.markdown +++ b/website/docs/cdktf/python/d/ec2_local_gateway.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about an EC2 Local Gateway --- + + # Data Source: aws_ec2_local_gateway Provides details about an EC2 Local Gateway. @@ -15,18 +17,21 @@ Provides details about an EC2 Local Gateway. The following example shows how one might accept a local gateway id as a variable. ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformVariable, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_local_gateway import DataAwsEc2LocalGateway +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. # You can read more about this at https://cdk.tf/variables - local_gateway_id = cdktf.TerraformVariable(self, "local_gateway_id") - aws.data_aws_ec2_local_gateway.DataAwsEc2LocalGateway(self, "selected", + local_gateway_id = TerraformVariable(self, "local_gateway_id") + DataAwsEc2LocalGateway(self, "selected", id=local_gateway_id.string_value ) ``` @@ -75,4 +80,4 @@ The following attributes are additionally exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_local_gateway_route_table.html.markdown b/website/docs/cdktf/python/d/ec2_local_gateway_route_table.html.markdown index acbc0a2581b..d139ef91b0c 100644 --- a/website/docs/cdktf/python/d/ec2_local_gateway_route_table.html.markdown +++ b/website/docs/cdktf/python/d/ec2_local_gateway_route_table.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about an EC2 Local Gateway Route Table --- + + # Data Source: aws_ec2_local_gateway_route_table Provides details about an EC2 Local Gateway Route Table. @@ -18,18 +20,21 @@ an input variable and needs to, for example, find the associated Outpost or Loca The following example returns a specific local gateway route table ID ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformVariable, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_local_gateway_route_table import DataAwsEc2LocalGatewayRouteTable +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. # You can read more about this at https://cdk.tf/variables - aws_ec2_local_gateway_route_table = cdktf.TerraformVariable(self, "aws_ec2_local_gateway_route_table") - aws.data_aws_ec2_local_gateway_route_table.DataAwsEc2LocalGatewayRouteTable(self, "selected", + aws_ec2_local_gateway_route_table = TerraformVariable(self, "aws_ec2_local_gateway_route_table") + DataAwsEc2LocalGatewayRouteTable(self, "selected", local_gateway_route_table_id=aws_ec2_local_gateway_route_table.string_value ) ``` @@ -66,4 +71,4 @@ which take the following arguments: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_local_gateway_route_tables.html.markdown b/website/docs/cdktf/python/d/ec2_local_gateway_route_tables.html.markdown index df9d201f1ab..15dd02d3608 100644 --- a/website/docs/cdktf/python/d/ec2_local_gateway_route_tables.html.markdown +++ b/website/docs/cdktf/python/d/ec2_local_gateway_route_tables.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Local Gateway Route Tables --- + + # Data Source: aws_ec2_local_gateway_route_tables Provides information for multiple EC2 Local Gateway Route Tables, such as their identifiers. @@ -15,18 +17,20 @@ Provides information for multiple EC2 Local Gateway Route Tables, such as their The following shows outputting all Local Gateway Route Table Ids. ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_local_gateway_route_tables import DataAwsEc2LocalGatewayRouteTables +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_aws_ec2_local_gateway_route_tables_foo = - aws.data_aws_ec2_local_gateway_route_tables.DataAwsEc2LocalGatewayRouteTables(self, "foo") - cdktf_terraform_output_foo = cdktf.TerraformOutput(self, "foo_1", - value=data_aws_ec2_local_gateway_route_tables_foo.ids + foo = DataAwsEc2LocalGatewayRouteTables(self, "foo") + cdktf_terraform_output_foo = TerraformOutput(self, "foo_1", + value=foo.ids ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. cdktf_terraform_output_foo.override_logical_id("foo") @@ -59,4 +63,4 @@ which take the following arguments: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface.html.markdown b/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface.html.markdown index 6e7f86766be..1176be49e82 100644 --- a/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface.html.markdown +++ b/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface.html.markdown @@ -6,18 +6,36 @@ description: |- Provides details about an EC2 Local Gateway Virtual Interface --- + + # Data Source: aws_ec2_local_gateway_virtual_interface Provides details about an EC2 Local Gateway Virtual Interface. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing). ## Example Usage -```terraform -data "aws_ec2_local_gateway_virtual_interface" "example" { - for_each = data.aws_ec2_local_gateway_virtual_interface_group.example.local_gateway_virtual_interface_ids - - id = each.value -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformIterator, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_local_gateway_virtual_interface import DataAwsEc2LocalGatewayVirtualInterface +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + example_for_each_iterator = TerraformIterator.from_list( + Token.as_any(data_aws_ec2_local_gateway_virtual_interface_group_example.local_gateway_virtual_interface_ids)) + DataAwsEc2LocalGatewayVirtualInterface(self, "example", + id=Token.as_string(example_for_each_iterator.value), + for_each=example_for_each_iterator + ) ``` ## Argument Reference @@ -52,4 +70,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface_group.html.markdown b/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface_group.html.markdown index e20f807a803..6a4d0eac810 100644 --- a/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface_group.html.markdown +++ b/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface_group.html.markdown @@ -6,16 +6,29 @@ description: |- Provides details about an EC2 Local Gateway Virtual Interface Group --- + + # Data Source: aws_ec2_local_gateway_virtual_interface_group Provides details about an EC2 Local Gateway Virtual Interface Group. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing). ## Example Usage -```terraform -data "aws_ec2_local_gateway_virtual_interface_group" "example" { - local_gateway_id = data.aws_ec2_local_gateway.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_local_gateway_virtual_interface_group import DataAwsEc2LocalGatewayVirtualInterfaceGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEc2LocalGatewayVirtualInterfaceGroup(self, "example", + local_gateway_id=Token.as_string(data_aws_ec2_local_gateway_example.id) + ) ``` ## Argument Reference @@ -46,4 +59,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface_groups.html.markdown b/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface_groups.html.markdown index 4578304cdc6..3cda2dc3f96 100644 --- a/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface_groups.html.markdown +++ b/website/docs/cdktf/python/d/ec2_local_gateway_virtual_interface_groups.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about multiple EC2 Local Gateway Virtual Interface Groups --- + + # Data Source: aws_ec2_local_gateway_virtual_interface_groups Provides details about multiple EC2 Local Gateway Virtual Interface Groups, such as identifiers. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing). @@ -13,15 +15,18 @@ Provides details about multiple EC2 Local Gateway Virtual Interface Groups, such ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_local_gateway_virtual_interface_groups import DataAwsEc2LocalGatewayVirtualInterfaceGroups +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_local_gateway_virtual_interface_groups.DataAwsEc2LocalGatewayVirtualInterfaceGroups(self, "all") + DataAwsEc2LocalGatewayVirtualInterfaceGroups(self, "all") ``` ## Argument Reference @@ -52,4 +57,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_local_gateways.html.markdown b/website/docs/cdktf/python/d/ec2_local_gateways.html.markdown index abda280ec16..468e6269394 100644 --- a/website/docs/cdktf/python/d/ec2_local_gateways.html.markdown +++ b/website/docs/cdktf/python/d/ec2_local_gateways.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Local Gateways --- + + # Data Source: aws_ec2_local_gateways Provides information for multiple EC2 Local Gateways, such as their identifiers. @@ -15,22 +17,24 @@ Provides information for multiple EC2 Local Gateways, such as their identifiers. The following example retrieves Local Gateways with a resource tag of `service` set to `production`. ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_local_gateways import DataAwsEc2LocalGateways +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_aws_ec2_local_gateways_foo = - aws.data_aws_ec2_local_gateways.DataAwsEc2LocalGateways(self, "foo", + foo = DataAwsEc2LocalGateways(self, "foo", tags={ "service": "production" } ) - cdktf_terraform_output_foo = cdktf.TerraformOutput(self, "foo_1", - value=data_aws_ec2_local_gateways_foo.ids + cdktf_terraform_output_foo = TerraformOutput(self, "foo_1", + value=foo.ids ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. cdktf_terraform_output_foo.override_logical_id("foo") @@ -63,4 +67,4 @@ which take the following arguments: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_managed_prefix_list.html.markdown b/website/docs/cdktf/python/d/ec2_managed_prefix_list.html.markdown index 086ae45d916..a3002ba8517 100644 --- a/website/docs/cdktf/python/d/ec2_managed_prefix_list.html.markdown +++ b/website/docs/cdktf/python/d/ec2_managed_prefix_list.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about a specific managed prefix list --- + + # Data Source: aws_ec2_managed_prefix_list `aws_ec2_managed_prefix_list` provides details about a specific AWS prefix list or @@ -16,32 +18,39 @@ customer-managed prefix list in the current region. ### Find the regional DynamoDB prefix list ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_managed_prefix_list import DataAwsEc2ManagedPrefixList +from imports.aws.data_aws_region import DataAwsRegion +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_aws_region_current = aws.data_aws_region.DataAwsRegion(self, "current") - aws.data_aws_ec2_managed_prefix_list.DataAwsEc2ManagedPrefixList(self, "example", - name="com.amazonaws.${" + data_aws_region_current.name + "}.dynamodb" + current = DataAwsRegion(self, "current") + DataAwsEc2ManagedPrefixList(self, "example", + name="com.amazonaws.${" + current.name + "}.dynamodb" ) ``` ### Find a managed prefix list using filters ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_managed_prefix_list import DataAwsEc2ManagedPrefixList +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_managed_prefix_list.DataAwsEc2ManagedPrefixList(self, "example", + DataAwsEc2ManagedPrefixList(self, "example", filter=[DataAwsEc2ManagedPrefixListFilter( name="prefix-list-name", values=["my-prefix-list"] @@ -86,4 +95,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_managed_prefix_lists.html.markdown b/website/docs/cdktf/python/d/ec2_managed_prefix_lists.html.markdown index dc7c5d0e364..0a89e73523b 100644 --- a/website/docs/cdktf/python/d/ec2_managed_prefix_lists.html.markdown +++ b/website/docs/cdktf/python/d/ec2_managed_prefix_lists.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on managed prefix lists --- + + # Data Source: aws_ec2_managed_prefix_lists This resource can be useful for getting back a list of managed prefix list ids to be referenced elsewhere. @@ -15,16 +17,19 @@ This resource can be useful for getting back a list of managed prefix list ids t The following returns all managed prefix lists filtered by tags ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformCount, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_managed_prefix_list import DataAwsEc2ManagedPrefixList +from imports.aws.data_aws_ec2_managed_prefix_lists import DataAwsEc2ManagedPrefixLists +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_aws_ec2_managed_prefix_lists_test_env = - aws.data_aws_ec2_managed_prefix_lists.DataAwsEc2ManagedPrefixLists(self, "test_env", + test_env = DataAwsEc2ManagedPrefixLists(self, "test_env", tags={ "Env": "test" } @@ -33,14 +38,12 @@ class MyConvertedCode(cdktf.TerraformStack): # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - data_aws_ec2_managed_prefix_list_test_env_count = cdktf.TerraformCount.of( - cdktf.Fn.length_of(data_aws_ec2_managed_prefix_lists_test_env.ids)) - data_aws_ec2_managed_prefix_list_test_env = - aws.data_aws_ec2_managed_prefix_list.DataAwsEc2ManagedPrefixList(self, "test_env_1", - id=cdktf.Token.as_string( - cdktf.property_access( - cdktf.Fn.tolist(data_aws_ec2_managed_prefix_lists_test_env.ids), [data_aws_ec2_managed_prefix_list_test_env_count.index])), - count=data_aws_ec2_managed_prefix_list_test_env_count + test_env_count = TerraformCount.of( + Token.as_number(Fn.length_of(test_env.ids))) + data_aws_ec2_managed_prefix_list_test_env = DataAwsEc2ManagedPrefixList(self, "test_env_1", + id=Token.as_string( + property_access(Fn.tolist(test_env.ids), [test_env_count.index])), + count=test_env_count ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_aws_ec2_managed_prefix_list_test_env.override_logical_id("test_env") @@ -71,4 +74,4 @@ which take the following arguments: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_network_insights_analysis.html.markdown b/website/docs/cdktf/python/d/ec2_network_insights_analysis.html.markdown index eed346f74e5..18bf2d49ab3 100644 --- a/website/docs/cdktf/python/d/ec2_network_insights_analysis.html.markdown +++ b/website/docs/cdktf/python/d/ec2_network_insights_analysis.html.markdown @@ -6,16 +6,29 @@ description: |- Provides details about a specific Network Insights Analysis. --- + + # Data Source: aws_ec2_network_insights_analysis `aws_ec2_network_insights_analysis` provides details about a specific Network Insights Analysis. ## Example Usage -```terraform -data "aws_ec2_network_insights_analysis" "example" { - network_insights_analysis_id = aws_ec2_network_insights_analysis.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_network_insights_analysis import DataAwsEc2NetworkInsightsAnalysis +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEc2NetworkInsightsAnalysis(self, "example", + network_insights_analysis_id=Token.as_string(aws_ec2_network_insights_analysis_example.id) + ) ``` ## Argument Reference @@ -51,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `status_message` - Message to provide more context when the `status` is `failed`. * `warning_message` - Warning message. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_network_insights_path.html.markdown b/website/docs/cdktf/python/d/ec2_network_insights_path.html.markdown index d55516021a1..3841f5937b5 100644 --- a/website/docs/cdktf/python/d/ec2_network_insights_path.html.markdown +++ b/website/docs/cdktf/python/d/ec2_network_insights_path.html.markdown @@ -6,16 +6,29 @@ description: |- Provides details about a specific Network Insights Path. --- + + # Data Source: aws_ec2_network_insights_path `aws_ec2_network_insights_path` provides details about a specific Network Insights Path. ## Example Usage -```terraform -data "aws_ec2_network_insights_path" "example" { - network_insights_path_id = aws_ec2_network_insights_path.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_network_insights_path import DataAwsEc2NetworkInsightsPath +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEc2NetworkInsightsPath(self, "example", + network_insights_path_id=Token.as_string(aws_ec2_network_insights_path_example.id) + ) ``` ## Argument Reference @@ -47,4 +60,4 @@ In addition to all arguments above, the following attributes are exported: * `source_ip` - IP address of the AWS resource that is the source of the path. * `tags` - Map of tags assigned to the resource. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_public_ipv4_pool.html.markdown b/website/docs/cdktf/python/d/ec2_public_ipv4_pool.html.markdown index ed3037f5406..281a7d8b275 100644 --- a/website/docs/cdktf/python/d/ec2_public_ipv4_pool.html.markdown +++ b/website/docs/cdktf/python/d/ec2_public_ipv4_pool.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about a specific AWS EC2 Public IPv4 Pool. --- + + # Data Source: aws_ec2_public_ipv4_pool Provides details about a specific AWS EC2 Public IPv4 Pool. @@ -15,15 +17,18 @@ Provides details about a specific AWS EC2 Public IPv4 Pool. ### Basic Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_public_ipv4_pool import DataAwsEc2PublicIpv4Pool +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_public_ipv4_pool.DataAwsEc2PublicIpv4Pool(self, "example", + DataAwsEc2PublicIpv4Pool(self, "example", pool_id="ipv4pool-ec2-000df99cff0c1ec10" ) ``` @@ -49,4 +54,4 @@ In addition to all arguments above, the following attributes are exported: * `total_address_count` - Total number of addresses in the pool. * `total_available_address_count` - Total number of available addresses in the pool. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_public_ipv4_pools.html.markdown b/website/docs/cdktf/python/d/ec2_public_ipv4_pools.html.markdown index f2e779ba37b..cd1d80c1e3e 100644 --- a/website/docs/cdktf/python/d/ec2_public_ipv4_pools.html.markdown +++ b/website/docs/cdktf/python/d/ec2_public_ipv4_pools.html.markdown @@ -6,6 +6,8 @@ description: |- Terraform data source for getting information about AWS EC2 Public IPv4 Pools. --- + + # Data Source: aws_ec2_public_ipv4_pools Terraform data source for getting information about AWS EC2 Public IPv4 Pools. @@ -15,29 +17,35 @@ Terraform data source for getting information about AWS EC2 Public IPv4 Pools. ### Basic Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_public_ipv4_pools import DataAwsEc2PublicIpv4Pools +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_public_ipv4_pools.DataAwsEc2PublicIpv4Pools(self, "example") + DataAwsEc2PublicIpv4Pools(self, "example") ``` ### Usage with Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_public_ipv4_pools import DataAwsEc2PublicIpv4Pools +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_public_ipv4_pools.DataAwsEc2PublicIpv4Pools(self, "example", + DataAwsEc2PublicIpv4Pools(self, "example", filter=[DataAwsEc2PublicIpv4PoolsFilter( name="tag-key", values=["ExampleTagKey"] @@ -63,4 +71,4 @@ which take the following arguments: * `pool_ids` - List of all the pool IDs found. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_serial_console_access.html.markdown b/website/docs/cdktf/python/d/ec2_serial_console_access.html.markdown index b3bd01b034d..56e9796a378 100644 --- a/website/docs/cdktf/python/d/ec2_serial_console_access.html.markdown +++ b/website/docs/cdktf/python/d/ec2_serial_console_access.html.markdown @@ -6,6 +6,8 @@ description: |- Checks whether serial console access is enabled for your AWS account in the current AWS region. --- + + # Data Source: aws_ec2_serial_console_access Provides a way to check whether serial console access is enabled for your AWS account in the current AWS region. @@ -13,15 +15,18 @@ Provides a way to check whether serial console access is enabled for your AWS ac ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_serial_console_access import DataAwsEc2SerialConsoleAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_serial_console_access.DataAwsEc2SerialConsoleAccess(self, "current") + DataAwsEc2SerialConsoleAccess(self, "current") ``` ## Attributes Reference @@ -37,4 +42,4 @@ The following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_spot_price.html.markdown b/website/docs/cdktf/python/d/ec2_spot_price.html.markdown index 6ec7e3ee99b..3acc6c185ae 100644 --- a/website/docs/cdktf/python/d/ec2_spot_price.html.markdown +++ b/website/docs/cdktf/python/d/ec2_spot_price.html.markdown @@ -6,6 +6,8 @@ description: |- Information about most recent Spot Price for a given EC2 instance. --- + + # Data Source: aws_ec2_spot_price Information about most recent Spot Price for a given EC2 instance. @@ -13,15 +15,18 @@ Information about most recent Spot Price for a given EC2 instance. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_spot_price import DataAwsEc2SpotPrice +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_spot_price.DataAwsEc2SpotPrice(self, "example", + DataAwsEc2SpotPrice(self, "example", availability_zone="us-west-2a", filter=[DataAwsEc2SpotPriceFilter( name="product-description", @@ -59,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway.html.markdown index db3fcdb43ce..de5735d1ff1 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway --- + + # Data Source: aws_ec2_transit_gateway Get information on an EC2 Transit Gateway. @@ -15,15 +17,18 @@ Get information on an EC2 Transit Gateway. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway import DataAwsEc2TransitGateway +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway.DataAwsEc2TransitGateway(self, "example", + DataAwsEc2TransitGateway(self, "example", filter=[DataAwsEc2TransitGatewayFilter( name="options.amazon-side-asn", values=["64512"] @@ -35,15 +40,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### By Identifier ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway import DataAwsEc2TransitGateway +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway.DataAwsEc2TransitGateway(self, "example", + DataAwsEc2TransitGateway(self, "example", id="tgw-12345678" ) ``` @@ -86,4 +94,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_attachment.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_attachment.html.markdown index 62925f85bd4..4cbb7798af4 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_attachment.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_attachment.html.markdown @@ -6,24 +6,36 @@ description: |- Get information on an EC2 Transit Gateway's attachment to a resource --- + + # Data Source: aws_ec2_transit_gateway_attachment Get information on an EC2 Transit Gateway's attachment to a resource. ## Example Usage -```terraform -data "aws_ec2_transit_gateway_attachment" "example" { - filter { - name = "transit-gateway-id" - values = [aws_ec2_transit_gateway.example.id] - } - - filter { - name = "resource-type" - values = ["peering"] - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_transit_gateway_attachment import DataAwsEc2TransitGatewayAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEc2TransitGatewayAttachment(self, "example", + filter=[DataAwsEc2TransitGatewayAttachmentFilter( + name="transit-gateway-id", + values=[Token.as_string(aws_ec2_transit_gateway_example.id)] + ), DataAwsEc2TransitGatewayAttachmentFilter( + name="resource-type", + values=["peering"] + ) + ] + ) ``` ## Argument Reference @@ -53,4 +65,4 @@ In addition to all arguments above, the following attributes are exported: * `transit_gateway_id` - ID of the transit gateway. * `transit_gateway_owner_id` - The ID of the AWS account that owns the transit gateway. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_attachments.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_attachments.html.markdown index 5cf23027ab9..8e61c55b7d8 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_attachments.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_attachments.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on EC2 Transit Gateway Attachments --- + + # Data Source: aws_ec2_transit_gateway_attachments Get information on EC2 Transit Gateway Attachments. @@ -14,23 +16,39 @@ Get information on EC2 Transit Gateway Attachments. ### By Filter -```hcl -data "aws_ec2_transit_gateway_attachments" "filtered" { - filter { - name = "state" - values = ["pendingAcceptance"] - } - - filter { - name = "resource-type" - values = ["vpc"] - } -} - -data "aws_ec2_transit_gateway_attachment" "unit" { - count = length(data.aws_ec2_transit_gateway_attachments.filtered.ids) - id = data.aws_ec2_transit_gateway_attachments.filtered.ids[count.index] -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformCount, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_transit_gateway_attachment import DataAwsEc2TransitGatewayAttachment +from imports.aws.data_aws_ec2_transit_gateway_attachments import DataAwsEc2TransitGatewayAttachments +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + filtered = DataAwsEc2TransitGatewayAttachments(self, "filtered", + filter=[DataAwsEc2TransitGatewayAttachmentsFilter( + name="state", + values=["pendingAcceptance"] + ), DataAwsEc2TransitGatewayAttachmentsFilter( + name="resource-type", + values=["vpc"] + ) + ] + ) + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + unit_count = TerraformCount.of( + Token.as_number(Fn.length_of(filtered.ids))) + DataAwsEc2TransitGatewayAttachment(self, "unit", + id=Token.as_string(property_access(filtered.ids, [unit_count.index])), + count=unit_count + ) ``` ## Argument Reference @@ -59,4 +77,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_connect.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_connect.html.markdown index 77a2acc4f3e..4a89010dc15 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_connect.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_connect.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Connect --- + + # Data Source: aws_ec2_transit_gateway_connect Get information on an EC2 Transit Gateway Connect. @@ -15,15 +17,18 @@ Get information on an EC2 Transit Gateway Connect. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_connect import DataAwsEc2TransitGatewayConnect +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_connect.DataAwsEc2TransitGatewayConnect(self, "example", + DataAwsEc2TransitGatewayConnect(self, "example", filter=[DataAwsEc2TransitGatewayConnectFilter( name="transport-transit-gateway-attachment-id", values=["tgw-attach-12345678"] @@ -35,15 +40,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### By Identifier ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_connect import DataAwsEc2TransitGatewayConnect +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_connect.DataAwsEc2TransitGatewayConnect(self, "example", + DataAwsEc2TransitGatewayConnect(self, "example", transit_gateway_connect_id="tgw-attach-12345678" ) ``` @@ -75,4 +83,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_connect_peer.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_connect_peer.html.markdown index 7f82e400e85..c1dd47bd822 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_connect_peer.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_connect_peer.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Connect Peer --- + + # Data Source: aws_ec2_transit_gateway_connect_peer Get information on an EC2 Transit Gateway Connect Peer. @@ -15,15 +17,18 @@ Get information on an EC2 Transit Gateway Connect Peer. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_connect_peer import DataAwsEc2TransitGatewayConnectPeer +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_connect_peer.DataAwsEc2TransitGatewayConnectPeer(self, "example", + DataAwsEc2TransitGatewayConnectPeer(self, "example", filter=[DataAwsEc2TransitGatewayConnectPeerFilter( name="transit-gateway-attachment-id", values=["tgw-attach-12345678"] @@ -35,15 +40,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### By Identifier ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_connect_peer import DataAwsEc2TransitGatewayConnectPeer +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_connect_peer.DataAwsEc2TransitGatewayConnectPeer(self, "example", + DataAwsEc2TransitGatewayConnectPeer(self, "example", transit_gateway_connect_peer_id="tgw-connect-peer-12345678" ) ``` @@ -66,6 +74,8 @@ In addition to all arguments above, the following attributes are exported: * `arn` - EC2 Transit Gateway Connect Peer ARN * `bgp_asn` - BGP ASN number assigned customer device +* `bgp_peer_address` - The IP address assigned to customer device, which is used as BGP IP address. +* `bgp_transit_gateway_addresses` - The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses. * `inside_cidr_blocks` - CIDR blocks that will be used for addressing within the tunnel. * `peer_address` - IP addressed assigned to customer device, which is used as tunnel endpoint * `tags` - Key-value tags for the EC2 Transit Gateway Connect Peer @@ -78,4 +88,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown index 76ccb6872d5..78f31a4c85d 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gateway --- + + # Data Source: aws_ec2_transit_gateway_dx_gateway_attachment Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gateway. @@ -14,11 +16,22 @@ Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gatew ### By Transit Gateway and Direct Connect Gateway Identifiers -```terraform -data "aws_ec2_transit_gateway_dx_gateway_attachment" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id - dx_gateway_id = aws_dx_gateway.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_transit_gateway_dx_gateway_attachment import DataAwsEc2TransitGatewayDxGatewayAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEc2TransitGatewayDxGatewayAttachment(self, "example", + dx_gateway_id=Token.as_string(aws_dx_gateway_example.id), + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id) + ) ``` ## Argument Reference @@ -50,4 +63,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_multicast_domain.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_multicast_domain.html.markdown index 6bcf5d5f5a4..58653a90360 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_multicast_domain.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_multicast_domain.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Multicast Domain --- + + # Data Source: aws_ec2_transit_gateway_multicast_domain Get information on an EC2 Transit Gateway Multicast Domain. @@ -15,15 +17,18 @@ Get information on an EC2 Transit Gateway Multicast Domain. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_multicast_domain import DataAwsEc2TransitGatewayMulticastDomain +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_multicast_domain.DataAwsEc2TransitGatewayMulticastDomain(self, "example", + DataAwsEc2TransitGatewayMulticastDomain(self, "example", filter=[DataAwsEc2TransitGatewayMulticastDomainFilter( name="transit-gateway-multicast-domain-id", values=["tgw-mcast-domain-12345678"] @@ -35,15 +40,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### By Identifier ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_multicast_domain import DataAwsEc2TransitGatewayMulticastDomain +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_multicast_domain.DataAwsEc2TransitGatewayMulticastDomain(self, "example", + DataAwsEc2TransitGatewayMulticastDomain(self, "example", transit_gateway_multicast_domain_id="tgw-mcast-domain-12345678" ) ``` @@ -92,4 +100,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_peering_attachment.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_peering_attachment.html.markdown index 51d5ad58170..7253d1f3270 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_peering_attachment.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_peering_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Peering Attachment --- + + # Data Source: aws_ec2_transit_gateway_peering_attachment Get information on an EC2 Transit Gateway Peering Attachment. @@ -15,15 +17,18 @@ Get information on an EC2 Transit Gateway Peering Attachment. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_peering_attachment import DataAwsEc2TransitGatewayPeeringAttachment +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_peering_attachment.DataAwsEc2TransitGatewayPeeringAttachment(self, "example", + DataAwsEc2TransitGatewayPeeringAttachment(self, "example", filter=[DataAwsEc2TransitGatewayPeeringAttachmentFilter( name="transit-gateway-attachment-id", values=["tgw-attach-12345678"] @@ -35,15 +40,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### By Identifier ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_peering_attachment import DataAwsEc2TransitGatewayPeeringAttachment +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_peering_attachment.DataAwsEc2TransitGatewayPeeringAttachment(self, "attachment", + DataAwsEc2TransitGatewayPeeringAttachment(self, "attachment", id="tgw-attach-12345678" ) ``` @@ -80,4 +88,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_route_table.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_route_table.html.markdown index fd856512692..9f61745de95 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_route_table.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_route_table.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Route Table --- + + # Data Source: aws_ec2_transit_gateway_route_table Get information on an EC2 Transit Gateway Route Table. @@ -15,15 +17,18 @@ Get information on an EC2 Transit Gateway Route Table. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_route_table import DataAwsEc2TransitGatewayRouteTable +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_route_table.DataAwsEc2TransitGatewayRouteTable(self, "example", + DataAwsEc2TransitGatewayRouteTable(self, "example", filter=[DataAwsEc2TransitGatewayRouteTableFilter( name="default-association-route-table", values=["true"] @@ -38,15 +43,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### By Identifier ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_route_table import DataAwsEc2TransitGatewayRouteTable +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_route_table.DataAwsEc2TransitGatewayRouteTable(self, "example", + DataAwsEc2TransitGatewayRouteTable(self, "example", id="tgw-rtb-12345678" ) ``` @@ -80,4 +88,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_route_table_associations.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_route_table_associations.html.markdown index 7f8572ce6b2..e6bc8adecd1 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_route_table_associations.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_route_table_associations.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Transit Gateway Route Table Associations --- + + # Data Source: aws_ec2_transit_gateway_route_table_associations Provides information for multiple EC2 Transit Gateway Route Table Associations, such as their identifiers. @@ -14,10 +16,21 @@ Provides information for multiple EC2 Transit Gateway Route Table Associations, ### By Transit Gateway Identifier -```terraform -data "aws_ec2_transit_gateway_route_table_associations" "example" { - transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_transit_gateway_route_table_associations import DataAwsEc2TransitGatewayRouteTableAssociations +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEc2TransitGatewayRouteTableAssociations(self, "example", + transit_gateway_route_table_id=Token.as_string(aws_ec2_transit_gateway_route_table_example.id) + ) ``` ## Argument Reference @@ -46,4 +59,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - AWS Region. * `ids` - Set of Transit Gateway Route Table Association identifiers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_route_table_propagations.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_route_table_propagations.html.markdown index 957a13f48bc..e03bead59fb 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_route_table_propagations.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_route_table_propagations.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Transit Gateway Route Table Propagations --- + + # Data Source: aws_ec2_transitgateway_route_table_propagations Provides information for multiple EC2 Transit Gateway Route Table Propagations, such as their identifiers. @@ -14,10 +16,21 @@ Provides information for multiple EC2 Transit Gateway Route Table Propagations, ### By Transit Gateway Identifier -```terraform -data "aws_ec2_transit_gateway_route_table_propagations" "example" { - transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_transit_gateway_route_table_propagations import DataAwsEc2TransitGatewayRouteTablePropagations +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEc2TransitGatewayRouteTablePropagations(self, "example", + transit_gateway_route_table_id=Token.as_string(aws_ec2_transit_gateway_route_table_example.id) + ) ``` ## Argument Reference @@ -46,4 +59,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - AWS Region. * `ids` - Set of Transit Gateway Route Table Association identifiers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_route_tables.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_route_tables.html.markdown index d00ff15c5f7..cccd1a7c9a3 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_route_tables.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_route_tables.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Transit Gateway Route Tables --- + + # Data Source: aws_ec2_transit_gateway_route_tables Provides information for multiple EC2 Transit Gateway Route Tables, such as their identifiers. @@ -14,12 +16,24 @@ Provides information for multiple EC2 Transit Gateway Route Tables, such as thei The following shows outputting all Transit Gateway Route Table Ids. -```terraform -data "aws_ec2_transit_gateway_route_tables" "example" {} - -output "example" { - value = data.aws_ec2_transit_gateway_route_table.example.ids -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_transit_gateway_route_tables import DataAwsEc2TransitGatewayRouteTables +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = DataAwsEc2TransitGatewayRouteTables(self, "example") + cdktf_terraform_output_example = TerraformOutput(self, "example_1", + value=example.ids + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + cdktf_terraform_output_example.override_logical_id("example") ``` ## Argument Reference @@ -53,4 +67,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_vpc_attachment.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_vpc_attachment.html.markdown index c113fcf3487..16a7ee2d006 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_vpc_attachment.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_vpc_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway VPC Attachment --- + + # Data Source: aws_ec2_transit_gateway_vpc_attachment Get information on an EC2 Transit Gateway VPC Attachment. @@ -15,15 +17,18 @@ Get information on an EC2 Transit Gateway VPC Attachment. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_vpc_attachment import DataAwsEc2TransitGatewayVpcAttachment +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_vpc_attachment.DataAwsEc2TransitGatewayVpcAttachment(self, "example", + DataAwsEc2TransitGatewayVpcAttachment(self, "example", filter=[DataAwsEc2TransitGatewayVpcAttachmentFilter( name="vpc-id", values=["vpc-12345678"] @@ -35,15 +40,18 @@ class MyConvertedCode(cdktf.TerraformStack): ### By Identifier ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_vpc_attachment import DataAwsEc2TransitGatewayVpcAttachment +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_vpc_attachment.DataAwsEc2TransitGatewayVpcAttachment(self, "example", + DataAwsEc2TransitGatewayVpcAttachment(self, "example", id="tgw-attach-12345678" ) ``` @@ -80,4 +88,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_vpc_attachments.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_vpc_attachments.html.markdown index 009c280d325..e2b7992d540 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_vpc_attachments.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_vpc_attachments.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on EC2 Transit Gateway VPC Attachments --- + + # Data Source: aws_ec2_transit_gateway_vpc_attachments Get information on EC2 Transit Gateway VPC Attachments. @@ -15,16 +17,19 @@ Get information on EC2 Transit Gateway VPC Attachments. ### By Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformCount, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_vpc_attachment import DataAwsEc2TransitGatewayVpcAttachment +from imports.aws.data_aws_ec2_transit_gateway_vpc_attachments import DataAwsEc2TransitGatewayVpcAttachments +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_aws_ec2_transit_gateway_vpc_attachments_filtered = - aws.data_aws_ec2_transit_gateway_vpc_attachments.DataAwsEc2TransitGatewayVpcAttachments(self, "filtered", + filtered = DataAwsEc2TransitGatewayVpcAttachments(self, "filtered", filter=[DataAwsEc2TransitGatewayVpcAttachmentsFilter( name="state", values=["pendingAcceptance"] @@ -35,13 +40,11 @@ class MyConvertedCode(cdktf.TerraformStack): # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source # you need to keep this like it is. - data_aws_ec2_transit_gateway_vpc_attachment_unit_count = - cdktf.TerraformCount.of( - cdktf.Fn.length_of(data_aws_ec2_transit_gateway_vpc_attachments_filtered.ids)) - aws.data_aws_ec2_transit_gateway_vpc_attachment.DataAwsEc2TransitGatewayVpcAttachment(self, "unit", - id=cdktf.Token.as_string( - cdktf.property_access(data_aws_ec2_transit_gateway_vpc_attachments_filtered.ids, [data_aws_ec2_transit_gateway_vpc_attachment_unit_count.index])), - count=data_aws_ec2_transit_gateway_vpc_attachment_unit_count + unit_count = TerraformCount.of( + Token.as_number(Fn.length_of(filtered.ids))) + DataAwsEc2TransitGatewayVpcAttachment(self, "unit", + id=Token.as_string(property_access(filtered.ids, [unit_count.index])), + count=unit_count ) ``` @@ -71,4 +74,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/ec2_transit_gateway_vpn_attachment.html.markdown b/website/docs/cdktf/python/d/ec2_transit_gateway_vpn_attachment.html.markdown index 4f3dde31294..924d0c9e104 100644 --- a/website/docs/cdktf/python/d/ec2_transit_gateway_vpn_attachment.html.markdown +++ b/website/docs/cdktf/python/d/ec2_transit_gateway_vpn_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway VPN Attachment --- + + # Data Source: aws_ec2_transit_gateway_vpn_attachment Get information on an EC2 Transit Gateway VPN Attachment. @@ -16,25 +18,39 @@ Get information on an EC2 Transit Gateway VPN Attachment. ### By Transit Gateway and VPN Connection Identifiers -```terraform -data "aws_ec2_transit_gateway_vpn_attachment" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id - vpn_connection_id = aws_vpn_connection.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ec2_transit_gateway_vpn_attachment import DataAwsEc2TransitGatewayVpnAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEc2TransitGatewayVpnAttachment(self, "example", + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id), + vpn_connection_id=Token.as_string(aws_vpn_connection_example.id) + ) ``` ### Filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_transit_gateway_vpn_attachment import DataAwsEc2TransitGatewayVpnAttachment +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.data_aws_ec2_transit_gateway_vpn_attachment.DataAwsEc2TransitGatewayVpnAttachment(self, "test", + DataAwsEc2TransitGatewayVpnAttachment(self, "test", filter=[DataAwsEc2TransitGatewayVpnAttachmentFilter( name="resource-id", values=["some-resource"] @@ -72,4 +88,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/eks_addon.html.markdown b/website/docs/cdktf/python/d/eks_addon.html.markdown new file mode 100644 index 00000000000..be87f241e8f --- /dev/null +++ b/website/docs/cdktf/python/d/eks_addon.html.markdown @@ -0,0 +1,57 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_addon" +description: |- + Retrieve information about an EKS add-on +--- + + + +# Data Source: aws_eks_addon + +Retrieve information about an EKS add-on. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_eks_addon import DataAwsEksAddon +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + TerraformOutput(self, "eks_addon_outputs", + value=example + ) + DataAwsEksAddon(self, "example", + addon_name="vpc-cni", + cluster_name=Token.as_string(aws_eks_cluster_example.name) + ) +``` + +## Argument Reference + +* `addon_name` – (Required) Name of the EKS add-on. The name must match one of + the names returned by [list-addon](https://docs.aws.amazon.com/cli/latest/reference/eks/list-addons.html). +* `cluster_name` – (Required) Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the EKS add-on. +* `addon_version` - Version of EKS add-on. +* `configuration_values` - Configuration values for the addon with a single JSON string. +* `service_account_role_arn` - ARN of IAM role used for EKS add-on. If value is empty - + then add-on uses the IAM role assigned to the EKS Cluster node. +* `id` - EKS Cluster name and EKS add-on name separated by a colon (`:`). +* `created_at` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was created. +* `modified_at` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/eks_addon_version.html.markdown b/website/docs/cdktf/python/d/eks_addon_version.html.markdown new file mode 100644 index 00000000000..50e4fbe46d9 --- /dev/null +++ b/website/docs/cdktf/python/d/eks_addon_version.html.markdown @@ -0,0 +1,70 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_addon_version" +description: |- + Retrieve information about versions of an EKS add-on +--- + + + +# Data Source: aws_eks_addon_version + +Retrieve information about a specific EKS add-on version compatible with an EKS cluster version. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_eks_addon_version import DataAwsEksAddonVersion +from imports.aws.eks_addon import EksAddon +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + default_var = DataAwsEksAddonVersion(self, "default", + addon_name="vpc-cni", + kubernetes_version=example.version + ) + latest = DataAwsEksAddonVersion(self, "latest", + addon_name="vpc-cni", + kubernetes_version=example.version, + most_recent=True + ) + cdktf_terraform_output_default = TerraformOutput(self, "default_2", + value=default_var.version + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + cdktf_terraform_output_default.override_logical_id("default") + cdktf_terraform_output_latest = TerraformOutput(self, "latest_3", + value=latest.version + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + cdktf_terraform_output_latest.override_logical_id("latest") + EksAddon(self, "vpc_cni", + addon_name="vpc-cni", + addon_version=Token.as_string(latest.version), + cluster_name=example.name + ) +``` + +## Argument Reference + +* `addon_name` – (Required) Name of the EKS add-on. The name must match one of + the names returned by [list-addon](https://docs.aws.amazon.com/cli/latest/reference/eks/list-addons.html). +* `kubernetes_version` – (Required) Version of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). +* `most_recent` - (Optional) Determines if the most recent or default version of the addon should be returned. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - Name of the add-on +* `version` - Version of the EKS add-on. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/eks_cluster.html.markdown b/website/docs/cdktf/python/d/eks_cluster.html.markdown new file mode 100644 index 00000000000..5382b7c8c69 --- /dev/null +++ b/website/docs/cdktf/python/d/eks_cluster.html.markdown @@ -0,0 +1,83 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_cluster" +description: |- + Retrieve information about an EKS Cluster +--- + + + +# Data Source: aws_eks_cluster + +Retrieve information about an EKS Cluster. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_eks_cluster import DataAwsEksCluster +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = DataAwsEksCluster(self, "example", + name="example" + ) + TerraformOutput(self, "endpoint", + value=example.endpoint + ) + TerraformOutput(self, "identity-oidc-issuer", + value=property_access(example.identity, ["0", "oidc", "0", "issuer"]) + ) + TerraformOutput(self, "kubeconfig-certificate-authority-data", + value=property_access(example.certificate_authority, ["0", "data"]) + ) +``` + +## Argument Reference + +* `name` - (Required) Name of the cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). + +## Attributes Reference + +* `id` - Name of the cluster +* `arn` - ARN of the cluster. +* `certificate_authority` - Nested attribute containing `certificate-authority-data` for your cluster. + * `data` - The base64 encoded certificate data required to communicate with your cluster. Add this to the `certificate-authority-data` section of the `kubeconfig` file for your cluster. +* `cluster_id` - The ID of your local Amazon EKS cluster on the AWS Outpost. This attribute isn't available for an AWS EKS cluster on AWS cloud. +* `created_at` - Unix epoch time stamp in seconds for when the cluster was created. +* `enabled_cluster_log_types` - The enabled control plane logs. +* `endpoint` - Endpoint for your Kubernetes API server. +* `identity` - Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the [`aws_eks_cluster` resource documentation](/docs/providers/aws/r/eks_cluster.html). + * `oidc` - Nested attribute containing [OpenID Connect](https://openid.net/connect/) identity provider information for the cluster. + * `issuer` - Issuer URL for the OpenID Connect identity provider. +* `kubernetes_network_config` - Nested list containing Kubernetes Network Configuration. + * `ip_family` - `ipv4` or `ipv6`. + * `service_ipv4_cidr` - The CIDR block to assign Kubernetes pod and service IP addresses from if `ipv4` was specified when the cluster was created. + * `service_ipv6_cidr` - The CIDR block to assign Kubernetes pod and service IP addresses from if `ipv6` was specified when the cluster was created. Kubernetes assigns service addresses from the unique local address range (fc00::/7) because you can't specify a custom IPv6 CIDR block when you create the cluster. +* `outpost_config` - Contains Outpost Configuration. + * `control_plane_instance_type` - The Amazon EC2 instance type for all Kubernetes control plane instances. + * `control_plane_placement` - An object representing the placement configuration for all the control plane instances of your local Amazon EKS cluster on AWS Outpost. + * `group_name` - The name of the placement group for the Kubernetes control plane instances. + * `outpost_arns` - List of ARNs of the Outposts hosting the EKS cluster. Only a single ARN is supported currently. +* `platform_version` - Platform version for the cluster. +* `role_arn` - ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. +* `status` - Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED`. +* `tags` - Key-value map of resource tags. +* `version` - Kubernetes server version for the cluster. +* `vpc_config` - Nested list containing VPC configuration for the cluster. + * `cluster_security_group_id` - The cluster security group that was created by Amazon EKS for the cluster. + * `endpoint_private_access` - Indicates whether or not the Amazon EKS private API server endpoint is enabled. + * `endpoint_public_access` - Indicates whether or not the Amazon EKS public API server endpoint is enabled. + * `public_access_cidrs` - List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint. + * `security_group_ids` – List of security group IDs + * `subnet_ids` – List of subnet IDs + * `vpc_id` – The VPC associated with your cluster. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/eks_cluster_auth.html.markdown b/website/docs/cdktf/python/d/eks_cluster_auth.html.markdown new file mode 100644 index 00000000000..7af3de8303c --- /dev/null +++ b/website/docs/cdktf/python/d/eks_cluster_auth.html.markdown @@ -0,0 +1,66 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_cluster_auth" +description: |- + Get an authentication token to communicate with an EKS Cluster +--- + + + +# Data Source: aws_eks_cluster_auth + +Get an authentication token to communicate with an EKS cluster. + +Uses IAM credentials from the AWS provider to generate a temporary token that is compatible with +[AWS IAM Authenticator](https://github.com/kubernetes-sigs/aws-iam-authenticator) authentication. +This can be used to authenticate to an EKS cluster or to a cluster that has the AWS IAM Authenticator +server configured. + +~> **NOTE:** Dynamically configuring a Terraform Provider via data sources currently has implications on [resource import support](https://github.com/hashicorp/terraform/issues/13018). + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import property_access, Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_eks_cluster import DataAwsEksCluster +from imports.aws.data_aws_eks_cluster_auth import DataAwsEksClusterAuth +from imports.kubernetes.provider import KubernetesProvider +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: kubernetes. + # For a more precise conversion please use the --provider flag in convert. + example = DataAwsEksCluster(self, "example", + name="example" + ) + data_aws_eks_cluster_auth_example = DataAwsEksClusterAuth(self, "example_1", + name="example" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_aws_eks_cluster_auth_example.override_logical_id("example") + KubernetesProvider(self, "kubernetes", + cluster_ca_certificate=Fn.base64decode( + Token.as_string( + property_access(example.certificate_authority, ["0", "data"]))), + host=example.endpoint, + token=data_aws_eks_cluster_auth_example.token + ) +``` + +## Argument Reference + +* `name` - (Required) Name of the cluster + +## Attributes Reference + +* `id` - Name of the cluster. +* `token` - Token to use to authenticate with the cluster. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/eks_clusters.html.markdown b/website/docs/cdktf/python/d/eks_clusters.html.markdown new file mode 100644 index 00000000000..2c503f46dc2 --- /dev/null +++ b/website/docs/cdktf/python/d/eks_clusters.html.markdown @@ -0,0 +1,50 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_clusters" +description: |- + Retrieve EKS Clusters list +--- + + + +# Data Source: aws_eks_clusters + +Retrieve EKS Clusters list + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformIterator, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_eks_cluster import DataAwsEksCluster +from imports.aws.data_aws_eks_clusters import DataAwsEksClusters +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = DataAwsEksClusters(self, "example") + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + example_for_each_iterator = TerraformIterator.from_list( + Token.as_any(Fn.toset(example.names))) + data_aws_eks_cluster_example = DataAwsEksCluster(self, "example_1", + name=Token.as_string(example_for_each_iterator.value), + for_each=example_for_each_iterator + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_aws_eks_cluster_example.override_logical_id("example") +``` + +## Attributes Reference + +* `id` - AWS Region. +* `names` - Set of EKS clusters names + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/eks_node_group.html.markdown b/website/docs/cdktf/python/d/eks_node_group.html.markdown new file mode 100644 index 00000000000..cbfbad2e9d3 --- /dev/null +++ b/website/docs/cdktf/python/d/eks_node_group.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_node_group" +description: |- + Retrieve information about an EKS Node Group +--- + + + +# Data Source: aws_eks_node_group + +Retrieve information about an EKS Node Group. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_eks_node_group import DataAwsEksNodeGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsEksNodeGroup(self, "example", + cluster_name="example", + node_group_name="example" + ) +``` + +## Argument Reference + +* `cluster_name` - (Required) Name of the cluster. +* `node_group_name` - (Required) Name of the node group. + +## Attributes Reference + +* `id` - EKS Cluster name and EKS Node Group name separated by a colon (`:`). +* `ami_type` - Type of Amazon Machine Image (AMI) associated with the EKS Node Group. +* `arn` - ARN of the EKS Node Group. +* `capacity_type` - Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`. +* `disk_size` - Disk size in GiB for worker nodes. +* `instance_types` - Set of instance types associated with the EKS Node Group. +* `labels` - Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed. +* `launch_template` - Nested attribute containing information about the launch template used to create the EKS Node Group. + * `id` - The ID of the launch template. + * `name` - The name of the launch template. + * `version` - The version number of the launch template. +* `node_role_arn` – ARN of the IAM Role that provides permissions for the EKS Node Group. +* `release_version` – AMI version of the EKS Node Group. +* `remote_access` - Configuration block with remote access settings. + * `ec2_ssh_key` - EC2 Key Pair name that provides access for SSH communication with the worker nodes in the EKS Node Group. + * `source_security_group_ids` - Set of EC2 Security Group IDs to allow SSH access (port 22) from on the worker nodes. +* `resources` - List of objects containing information about underlying resources. + * `autoscaling_groups` - List of objects containing information about AutoScaling Groups. + * `name` - Name of the AutoScaling Group. + * `remote_access_security_group_id` - Identifier of the remote access EC2 Security Group. +* `scaling_config` - Configuration block with scaling settings. + * `desired_size` - Desired number of worker nodes. + * `max_size` - Maximum number of worker nodes. + * `min_size` - Minimum number of worker nodes. +* `status` - Status of the EKS Node Group. +* `subnet_ids` – Identifiers of EC2 Subnets to associate with the EKS Node Group. +* `taints` - List of objects containing information about taints applied to the nodes in the EKS Node Group. + * `key` - The key of the taint. + * `value` - The value of the taint. + * `effect` - The effect of the taint. +* `tags` - Key-value map of resource tags. +* `version` – Kubernetes version. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/eks_node_groups.html.markdown b/website/docs/cdktf/python/d/eks_node_groups.html.markdown new file mode 100644 index 00000000000..036c6afbd59 --- /dev/null +++ b/website/docs/cdktf/python/d/eks_node_groups.html.markdown @@ -0,0 +1,57 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_node_groups" +description: |- + Provides a set of node groups for an EKS Cluster +--- + + + +# Data Source: aws_eks_node_groups + +Retrieve the EKS Node Groups associated with a named EKS cluster. This will allow you to pass a list of Node Group names to other resources. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformIterator, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_eks_node_group import DataAwsEksNodeGroup +from imports.aws.data_aws_eks_node_groups import DataAwsEksNodeGroups +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = DataAwsEksNodeGroups(self, "example", + cluster_name="example" + ) + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + example_for_each_iterator = TerraformIterator.from_list( + Token.as_any(example.names)) + data_aws_eks_node_group_example = DataAwsEksNodeGroup(self, "example_1", + cluster_name="example", + node_group_name=Token.as_string(example_for_each_iterator.value), + for_each=example_for_each_iterator + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_aws_eks_node_group_example.override_logical_id("example") +``` + +## Argument Reference + +* `cluster_name` - (Required) Name of the cluster. + +## Attributes Reference + +* `id` - Cluster name. +* `names` - Set of all node group names in an EKS Cluster. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/lambda_alias.html.markdown b/website/docs/cdktf/python/d/lambda_alias.html.markdown new file mode 100644 index 00000000000..36c53e2cab1 --- /dev/null +++ b/website/docs/cdktf/python/d/lambda_alias.html.markdown @@ -0,0 +1,51 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_alias" +description: |- + Provides a Lambda Alias data source. +--- + + + +# Data Source: aws_lambda_alias + +Provides information about a Lambda Alias. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_lambda_alias import DataAwsLambdaAlias +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsLambdaAlias(self, "production", + function_name="my-lambda-func", + name="production" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `function_name` - (Required) Name of the aliased Lambda function. +* `name` - (Required) Name of the Lambda alias. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN identifying the Lambda function alias. +* `description` - Description of alias. +* `function_version` - Lambda function version which the alias uses. +* `invoke_arn` - ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_integration's `uri`. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/lambda_code_signing_config.html.markdown b/website/docs/cdktf/python/d/lambda_code_signing_config.html.markdown new file mode 100644 index 00000000000..c49b9efabe3 --- /dev/null +++ b/website/docs/cdktf/python/d/lambda_code_signing_config.html.markdown @@ -0,0 +1,62 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_code_signing_config" +description: |- + Provides a Lambda Code Signing Config data source. +--- + + + +# Data Source: aws_lambda_code_signing_config + +Provides information about a Lambda Code Signing Config. A code signing configuration defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if deployment validation checks fail). + +For information about Lambda code signing configurations and how to use them, see [configuring code signing for Lambda functions][1] + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_lambda_code_signing_config import DataAwsLambdaCodeSigningConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsLambdaCodeSigningConfig(self, "existing_csc", + arn="arn:aws:lambda:${" + aws_region.value + "}:${" + aws_account.value + "}:code-signing-config:csc-0f6c334abcdea4d8b" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `arn` - (Required) ARN of the code signing configuration. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `allowed_publishers` - List of allowed publishers as signing profiles for this code signing configuration. +* `config_id` - Unique identifier for the code signing configuration. +* `description` - Code signing configuration description. +* `last_modified` - Date and time that the code signing configuration was last modified. +* `policies` - List of code signing policies that control the validation failure action for signature mismatch or expiry. + +`allowed_publishers` is exported with the following attribute: + +* `signing_profile_version_arns` - The ARN for each of the signing profiles. A signing profile defines a trusted user who can sign a code package. + +`policies` is exported with the following attribute: + +* `untrusted_artifact_on_deployment` - Code signing configuration policy for deployment validation failure. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/lambda_function.html.markdown b/website/docs/cdktf/python/d/lambda_function.html.markdown new file mode 100644 index 00000000000..42bec68d9f2 --- /dev/null +++ b/website/docs/cdktf/python/d/lambda_function.html.markdown @@ -0,0 +1,79 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function" +description: |- + Provides a Lambda Function data source. +--- + + + +# aws_lambda_function + +Provides information about a Lambda Function. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import VariableType, TerraformVariable, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_lambda_function import DataAwsLambdaFunction +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + # You can read more about this at https://cdk.tf/variables + function_name = TerraformVariable(self, "function_name", + type=VariableType.STRING + ) + DataAwsLambdaFunction(self, "existing", + function_name=function_name.string_value + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `function_name` - (Required) Name of the lambda function. +* `qualifier` - (Optional) Alias name or version number of the lambda functionE.g., `$LATEST`, `my-alias`, or `1`. When not included: the data source resolves to the most recent published version; if no published version exists: it resolves to the most recent unpublished version. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `architectures` - Instruction set architecture for the Lambda function. +* `arn` - Unqualified (no `:QUALIFIER` or `:VERSION` suffix) ARN identifying your Lambda Function. See also `qualified_arn`. +* `code_signing_config_arn` - ARN for a Code Signing Configuration. +* `dead_letter_config` - Configure the function's *dead letter queue*. +* `description` - Description of what your Lambda Function does. +* `environment` - Lambda environment's configuration settings. +* `ephemeral_storage` - Amount of Ephemeral storage(`/tmp`) allocated for the Lambda Function. +* `file_system_config` - Connection settings for an Amazon EFS file system. +* `handler` - Function entrypoint in your code. +* `image_uri` - URI of the container image. +* `invoke_arn` - ARN to be used for invoking Lambda Function from API Gateway. **NOTE:** Starting with `v4.51.0` of the provider, this will *not* include the qualifier. +* `kms_key_arn` - ARN for the KMS encryption key. +* `last_modified` - Date this resource was last modified. +* `layers` - List of Lambda Layer ARNs attached to your Lambda Function. +* `memory_size` - Amount of memory in MB your Lambda Function can use at runtime. +* `qualified_arn` - Qualified (`:QUALIFIER` or `:VERSION` suffix) ARN identifying your Lambda Function. See also `arn`. +* `qualified_invoke_arn` - Qualified (`:QUALIFIER` or `:VERSION` suffix) ARN to be used for invoking Lambda Function from API Gateway. See also `invoke_arn`. +* `reserved_concurrent_executions` - The amount of reserved concurrent executions for this lambda function or `-1` if unreserved. +* `role` - IAM role attached to the Lambda Function. +* `runtime` - Runtime environment for the Lambda function. +* `signing_job_arn` - ARN of a signing job. +* `signing_profile_version_arn` - The ARN for a signing profile version. +* `source_code_hash` - Base64-encoded representation of raw SHA-256 sum of the zip file. +* `source_code_size` - Size in bytes of the function .zip file. +* `timeout` - Function execution time at which Lambda should terminate the function. +* `tracing_config` - Tracing settings of the function. +* `version` - The version of the Lambda function returned. If `qualifier` is not set, this will resolve to the most recent published version. If no published version of the function exists, `version` will resolve to `$LATEST`. +* `vpc_config` - VPC configuration associated with your Lambda function. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/lambda_function_url.html.markdown b/website/docs/cdktf/python/d/lambda_function_url.html.markdown new file mode 100644 index 00000000000..89c999f7cbb --- /dev/null +++ b/website/docs/cdktf/python/d/lambda_function_url.html.markdown @@ -0,0 +1,59 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function_url" +description: |- + Provides a Lambda function URL data source. +--- + + + +# aws_lambda_function_url + +Provides information about a Lambda function URL. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import VariableType, TerraformVariable, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_lambda_function_url import DataAwsLambdaFunctionUrl +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + # You can read more about this at https://cdk.tf/variables + function_name = TerraformVariable(self, "function_name", + type=VariableType.STRING + ) + DataAwsLambdaFunctionUrl(self, "existing", + function_name=function_name.string_value + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `function_name` - (Required) he name (or ARN) of the Lambda function. +* `qualifier` - (Optional) Alias name or `"$LATEST"`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `authorization_type` - Type of authentication that the function URL uses. +* `cors` - The [cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for the function URL. See the [`aws_lambda_function_url` resource](/docs/providers/aws/r/lambda_function_url.html) documentation for more details. +* `creation_time` - When the function URL was created, in [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime). +* `function_arn` - ARN of the function. +* `function_url` - HTTP URL endpoint for the function in the format `https://.lambda-url..on.aws`. +* `invoke_mode` - Whether the Lambda function responds in `BUFFERED` or `RESPONSE_STREAM` mode. +* `last_modified_time` - When the function URL configuration was last updated, in [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime). +* `url_id` - Generated ID for the endpoint. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/lambda_functions.html.markdown b/website/docs/cdktf/python/d/lambda_functions.html.markdown new file mode 100644 index 00000000000..4d95b564057 --- /dev/null +++ b/website/docs/cdktf/python/d/lambda_functions.html.markdown @@ -0,0 +1,43 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_functions" +description: |- + Terraform data resource to get a list of Lambda Functions. +--- + + + +# aws_lambda_functions + +Terraform data resource to get a list of Lambda Functions. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_lambda_functions import DataAwsLambdaFunctions +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsLambdaFunctions(self, "all") +``` + +## Argument Reference + +The resource does not support any arguments. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `function_names` - A list of Lambda Function names. +* `function_arns` - A list of Lambda Function ARNs. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/lambda_invocation.html.markdown b/website/docs/cdktf/python/d/lambda_invocation.html.markdown new file mode 100644 index 00000000000..791277322e1 --- /dev/null +++ b/website/docs/cdktf/python/d/lambda_invocation.html.markdown @@ -0,0 +1,54 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_invocation" +description: |- + Invoke AWS Lambda Function as data source +--- + + + +# Data Source: aws_lambda_invocation + +Use this data source to invoke custom lambda functions as data source. +The lambda function is invoked with [RequestResponse](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) +invocation type. + +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, Fn, Token, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_lambda_invocation import DataAwsLambdaInvocation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = DataAwsLambdaInvocation(self, "example", + function_name=lambda_function_test.function_name, + input="{\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n}\n\n" + ) + TerraformOutput(self, "result_entry", + value=property_access(Fn.jsondecode(Token.as_string(example.result)), ["\"key1\"" + ]) + ) +``` + +## Argument Reference + +* `function_name` - (Required) Name of the lambda function. +* `input` - (Required) String in JSON format that is passed as payload to the lambda function. +* `qualifier` - (Optional) Qualifier (a.k.a version) of the lambda function. Defaults + to `$LATEST`. + +## Attributes Reference + +* `result` - String result of the lambda function invocation. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/lambda_layer_version.html.markdown b/website/docs/cdktf/python/d/lambda_layer_version.html.markdown new file mode 100644 index 00000000000..35265281430 --- /dev/null +++ b/website/docs/cdktf/python/d/lambda_layer_version.html.markdown @@ -0,0 +1,68 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_layer_version" +description: |- + Provides a Lambda Layer Version data source. +--- + + + +# aws_lambda_layer_version + +Provides information about a Lambda Layer Version. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import VariableType, TerraformVariable, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_lambda_layer_version import DataAwsLambdaLayerVersion +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + # You can read more about this at https://cdk.tf/variables + layer_name = TerraformVariable(self, "layer_name", + type=VariableType.STRING + ) + DataAwsLambdaLayerVersion(self, "existing", + layer_name=layer_name.string_value + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `layer_name` - (Required) Name of the lambda layer. +* `version` - (Optional) Specific layer version. Conflicts with `compatible_runtime` and `compatible_architecture`. If omitted, the latest available layer version will be used. +* `compatible_runtime` (Optional) Specific runtime the layer version must support. Conflicts with `version`. If specified, the latest available layer version supporting the provided runtime will be used. +* `compatible_architecture` (Optional) Specific architecture the layer version could support. Conflicts with `version`. If specified, the latest available layer version supporting the provided architecture will be used. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `description` - Description of the specific Lambda Layer version. +* `license_info` - License info associated with the specific Lambda Layer version. +* `compatible_runtimes` - List of [Runtimes][1] the specific Lambda Layer version is compatible with. +* `compatible_architectures` - A list of [Architectures][2] the specific Lambda Layer version is compatible with. +* `arn` - ARN of the Lambda Layer with version. +* `layer_arn` - ARN of the Lambda Layer without version. +* `created_date` - Date this resource was created. +* `signing_job_arn` - ARN of a signing job. +* `signing_profile_version_arn` - The ARN for a signing profile version. +* `source_code_hash` - Base64-encoded representation of raw SHA-256 sum of the zip file. +* `source_code_size` - Size in bytes of the function .zip file. +* `version` - This Lamba Layer version. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersion.html#SSS-GetLayerVersion-response-CompatibleRuntimes +[2]: https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersion.html#SSS-GetLayerVersion-response-CompatibleArchitectures + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc.html.markdown b/website/docs/cdktf/python/d/vpc.html.markdown new file mode 100644 index 00000000000..1cd65241831 --- /dev/null +++ b/website/docs/cdktf/python/d/vpc.html.markdown @@ -0,0 +1,116 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc" +description: |- + Provides details about a specific VPC +--- + + + +# Data Source: aws_vpc + +`aws_vpc` provides details about a specific VPC. + +This resource can prove useful when a module accepts a vpc id as +an input variable and needs to, for example, determine the CIDR block of that +VPC. + +## Example Usage + +The following example shows how one might accept a VPC id as a variable +and use this data source to obtain the data necessary to create a subnet +within it. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformVariable, Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc import DataAwsVpc +from imports.aws.subnet import Subnet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + # You can read more about this at https://cdk.tf/variables + vpc_id = TerraformVariable(self, "vpc_id") + selected = DataAwsVpc(self, "selected", + id=vpc_id.string_value + ) + Subnet(self, "example", + availability_zone="us-west-2a", + cidr_block=Token.as_string( + Fn.cidrsubnet(Token.as_string(selected.cidr_block), 4, 1)), + vpc_id=Token.as_string(selected.id) + ) +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +VPCs in the current region. The given filters must match exactly one +VPC whose data will be exported as attributes. + +* `cidr_block` - (Optional) Cidr block of the desired VPC. + +* `dhcp_options_id` - (Optional) DHCP options id of the desired VPC. + +* `default` - (Optional) Boolean constraint on whether the desired VPC is + the default VPC for the region. + +* `filter` - (Optional) Custom filter block as described below. + +* `id` - (Optional) ID of the specific VPC to retrieve. + +* `state` - (Optional) Current state of the desired VPC. + Can be either `"pending"` or `"available"`. + +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the desired VPC. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC will be selected if any one of the given values matches. + +## Attributes Reference + +All of the argument attributes except `filter` blocks are also exported as +result attributes. This data source will complete the data by populating +any fields that are not included in the configuration with the data for +the selected VPC. + +The following attribute is additionally exported: + +* `arn` - ARN of VPC +* `enable_dns_support` - Whether or not the VPC has DNS support +* `enable_network_address_usage_metrics` - Whether Network Address Usage metrics are enabled for your VPC +* `enable_dns_hostnames` - Whether or not the VPC has DNS hostname support +* `instance_tenancy` - Allowed tenancy of instances launched into the + selected VPC. May be any of `"default"`, `"dedicated"`, or `"host"`. +* `ipv6_association_id` - Association ID for the IPv6 CIDR block. +* `ipv6_cidr_block` - IPv6 CIDR block. +* `main_route_table_id` - ID of the main route table associated with this VPC. +* `owner_id` - ID of the AWS account that owns the VPC. + +`cidr_block_associations` is also exported with the following attributes: + +* `association_id` - Association ID for the IPv4 CIDR block. +* `cidr_block` - CIDR block for the association. +* `state` - State of the association. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_dhcp_options.html.markdown b/website/docs/cdktf/python/d/vpc_dhcp_options.html.markdown new file mode 100644 index 00000000000..76e151f3eae --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_dhcp_options.html.markdown @@ -0,0 +1,93 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_dhcp_options" +description: |- + Retrieve information about an EC2 DHCP Options configuration +--- + + + +# Data Source: aws_vpc_dhcp_options + +Retrieve information about an EC2 DHCP Options configuration. + +## Example Usage + +### Lookup by DHCP Options ID + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_dhcp_options import DataAwsVpcDhcpOptions +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpcDhcpOptions(self, "example", + dhcp_options_id="dopts-12345678" + ) +``` + +### Lookup by Filter + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_dhcp_options import DataAwsVpcDhcpOptions +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpcDhcpOptions(self, "example", + filter=[DataAwsVpcDhcpOptionsFilter( + name="key", + values=["domain-name"] + ), DataAwsVpcDhcpOptionsFilter( + name="value", + values=["example.com"] + ) + ] + ) +``` + +## Argument Reference + +* `dhcp_options_id` - (Optional) EC2 DHCP Options ID. +* `filter` - (Optional) List of custom filters as described below. + +### filter + +For more information about filtering, see the [EC2 API documentation](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeDhcpOptions.html). + +* `name` - (Required) Name of the field to filter. +* `values` - (Required) Set of values for filtering. + +## Attributes Reference + +* `arn` - ARN of the DHCP Options Set. +* `dhcp_options_id` - EC2 DHCP Options ID +* `domain_name` - Suffix domain name to used when resolving non Fully Qualified Domain NamesE.g., the `search` value in the `/etc/resolv.conf` file. +* `domain_name_servers` - List of name servers. +* `id` - EC2 DHCP Options ID +* `netbios_name_servers` - List of NETBIOS name servers. +* `netbios_node_type` - NetBIOS node type (1, 2, 4, or 8). For more information about these node types, see [RFC 2132](http://www.ietf.org/rfc/rfc2132.txt). +* `ntp_servers` - List of NTP servers. +* `tags` - Map of tags assigned to the resource. +* `owner_id` - ID of the AWS account that owns the DHCP options set. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_endpoint.html.markdown b/website/docs/cdktf/python/d/vpc_endpoint.html.markdown new file mode 100644 index 00000000000..2907de937d7 --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_endpoint.html.markdown @@ -0,0 +1,91 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint" +description: |- + Provides details about a specific VPC endpoint. +--- + + + +# Data Source: aws_vpc_endpoint + +The VPC Endpoint data source provides details about +a specific VPC endpoint. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_endpoint import DataAwsVpcEndpoint +from imports.aws.vpc_endpoint_route_table_association import VpcEndpointRouteTableAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + s3 = DataAwsVpcEndpoint(self, "s3", + service_name="com.amazonaws.us-west-2.s3", + vpc_id=foo.id + ) + VpcEndpointRouteTableAssociation(self, "private_s3", + route_table_id=private.id, + vpc_endpoint_id=Token.as_string(s3.id) + ) +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available VPC endpoints. +The given filters must match exactly one VPC endpoint whose data will be exported as attributes. + +* `filter` - (Optional) Custom filter block as described below. +* `id` - (Optional) ID of the specific VPC Endpoint to retrieve. +* `service_name` - (Optional) Service name of the specific VPC Endpoint to retrieve. For AWS services the service name is usually in the form `com.amazonaws..` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker..notebook`). +* `state` - (Optional) State of the specific VPC Endpoint to retrieve. +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the specific VPC Endpoint to retrieve. +* `vpc_id` - (Optional) ID of the VPC in which the specific VPC Endpoint is used. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcEndpoints.html). +* `values` - (Required) Set of values that are accepted for the given field. + A VPC Endpoint will be selected if any one of the given values matches. + +## Attributes Reference + +In addition to all arguments above except `filter`, the following attributes are exported: + +* `arn` - ARN of the VPC endpoint. +* `cidr_blocks` - List of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `Gateway`. +* `dns_entry` - DNS entries for the VPC Endpoint. Applicable for endpoints of type `Interface`. DNS blocks are documented below. +* `network_interface_ids` - One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `Interface`. +* `owner_id` - ID of the AWS account that owns the VPC endpoint. +* `policy` - Policy document associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`. +* `prefix_list_id` - Prefix list ID of the exposed AWS service. Applicable for endpoints of type `Gateway`. +* `private_dns_enabled` - Whether or not the VPC is associated with a private hosted zone - `true` or `false`. Applicable for endpoints of type `Interface`. +* `requester_managed` - Whether or not the VPC Endpoint is being managed by its service - `true` or `false`. +* `route_table_ids` - One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type `Gateway`. +* `security_group_ids` - One or more security groups associated with the network interfaces. Applicable for endpoints of type `Interface`. +* `subnet_ids` - One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type `Interface`. +* `vpc_endpoint_type` - VPC Endpoint type, `Gateway` or `Interface`. + +DNS blocks (for `dns_entry`) support the following attributes: + +* `dns_name` - DNS name. +* `hosted_zone_id` - ID of the private hosted zone. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_endpoint_service.html.markdown b/website/docs/cdktf/python/d/vpc_endpoint_service.html.markdown new file mode 100644 index 00000000000..98160c5f78b --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_endpoint_service.html.markdown @@ -0,0 +1,131 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_service" +description: |- + Provides details about a specific service that can be specified when creating a VPC endpoint. +--- + + + +# Data Source: aws_vpc_endpoint_service + +The VPC Endpoint Service data source details about a specific service that +can be specified when creating a VPC endpoint within the region configured in the provider. + +## Example Usage + +### AWS Service + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_endpoint_service import DataAwsVpcEndpointService +from imports.aws.vpc import Vpc +from imports.aws.vpc_endpoint import VpcEndpoint +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + foo = Vpc(self, "foo", + cidr_block="10.0.0.0/16" + ) + s3 = DataAwsVpcEndpointService(self, "s3", + service="s3", + service_type="Gateway" + ) + VpcEndpoint(self, "ep", + service_name=Token.as_string(s3.service_name), + vpc_id=foo.id + ) +``` + +### Non-AWS Service + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_endpoint_service import DataAwsVpcEndpointService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpcEndpointService(self, "custome", + service_name="com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8" + ) +``` + +### Filter + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_endpoint_service import DataAwsVpcEndpointService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpcEndpointService(self, "test", + filter=[DataAwsVpcEndpointServiceFilter( + name="service-name", + values=["some-service"] + ) + ] + ) +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available VPC endpoint services. +The given filters must match exactly one VPC endpoint service whose data will be exported as attributes. + +* `filter` - (Optional) Configuration block(s) for filtering. Detailed below. +* `service` - (Optional) Common name of an AWS service (e.g., `s3`). +* `service_name` - (Optional) Service name that is specified when creating a VPC endpoint. For AWS services the service name is usually in the form `com.amazonaws..` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker..notebook`). +* `service_type` - (Optional) Service type, `Gateway` or `Interface`. +* `tags` - (Optional) Map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service. + +~> **NOTE:** Specifying `service` will not work for non-AWS services or AWS services that don't follow the standard `service_name` pattern of `com.amazonaws..`. + +### filter Configuration Block + +The following arguments are supported by the `filter` configuration block: + +* `name` - (Required) Name of the filter field. Valid values can be found in the [EC2 DescribeVpcEndpointServices API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcEndpointServices.html). +* `values` - (Required) Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `acceptance_required` - Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`. +* `arn` - ARN of the VPC endpoint service. +* `availability_zones` - Availability Zones in which the service is available. +* `base_endpoint_dns_names` - The DNS names for the service. +* `manages_vpc_endpoints` - Whether or not the service manages its VPC endpoints - `true` or `false`. +* `owner` - AWS account ID of the service owner or `amazon`. +* `private_dns_name` - Private DNS name for the service. +* `service_id` - ID of the endpoint service. +* `supported_ip_address_types` - The supported IP address types. +* `tags` - Map of tags assigned to the resource. +* `vpc_endpoint_policy_supported` - Whether or not the service supports endpoint policies - `true` or `false`. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_ipam_pool.html.markdown b/website/docs/cdktf/python/d/vpc_ipam_pool.html.markdown new file mode 100644 index 00000000000..4f91a3477f0 --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_ipam_pool.html.markdown @@ -0,0 +1,101 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool" +description: |- + Returns details about the first IPAM pool that matches search parameters provided. +--- + + + +# Data Source: aws_vpc_ipam_pool + +`aws_vpc_ipam_pool` provides details about an IPAM pool. + +This resource can prove useful when an ipam pool was created in another root +module and you need the pool's id as an input variable. For example, pools +can be shared via RAM and used to create vpcs with CIDRs from that pool. + +## Example Usage + +The following example shows an account that has only 1 pool, perhaps shared +via RAM, and using that pool id to create a VPC with a CIDR derived from +AWS IPAM. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_ipam_pool import DataAwsVpcIpamPool +from imports.aws.vpc import Vpc +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = DataAwsVpcIpamPool(self, "test", + filter=[DataAwsVpcIpamPoolFilter( + name="description", + values=["*test*"] + ), DataAwsVpcIpamPoolFilter( + name="address-family", + values=["ipv4"] + ) + ] + ) + aws_vpc_test = Vpc(self, "test_1", + ipv4_ipam_pool_id=Token.as_string(test.id), + ipv4_netmask_length=28 + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_test.override_logical_id("test") +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +VPCs in the current region. The given filters must match exactly one +VPC whose data will be exported as attributes. + +* `ipam_pool_id` - (Optional) ID of the IPAM pool you would like information on. +* `filter` - (Optional) Custom filter block as described below. + +### filter + +* `name` - (Required) The name of the filter. Filter names are case-sensitive. +* `values` - (Required) The filter values. Filter values are case-sensitive. + +## Attributes Reference + +All of the argument attributes except `filter` blocks are also exported as +result attributes. This data source will complete the data by populating +any fields that are not included in the configuration with the data for +the selected VPC. + +The following attribute is additionally exported: + +* `address_family` - IP protocol assigned to this pool. +* `allocation_default_netmask_length` - A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is `10.0.0.0/8` and you enter 16 here, new allocations will default to `10.0.0.0/16`. +* `allocation_max_netmask_length` - The maximum netmask length that will be required for CIDR allocations in this pool. +* `allocation_min_netmask_length` - The minimum netmask length that will be required for CIDR allocations in this pool. +* `allocation_resource_tags` - Tags that are required to create resources in using this pool. +* `arn` - ARN of the pool +* `auto_import` - If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. +* `aws_service` - Limits which service in AWS that the pool can be used in. `ec2` for example, allows users to use space for Elastic IP addresses and VPCs. +* `description` - Description for the IPAM pool. +* `id` - ID of the IPAM pool. +* `ipam_scope_id` - ID of the scope the pool belongs to. +* `locale` - Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. +* `publicly_advertisable` - Defines whether or not IPv6 pool space is publicly advertisable over the internet. +* `source_ipam_pool_id` - ID of the source IPAM pool. +* `tags` - Map of tags to assigned to the resource. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_ipam_pool_cidrs.html.markdown b/website/docs/cdktf/python/d/vpc_ipam_pool_cidrs.html.markdown new file mode 100644 index 00000000000..20cb8276773 --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_ipam_pool_cidrs.html.markdown @@ -0,0 +1,121 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool_cidrs" +description: |- + Returns cidrs provisioned into an IPAM pool. +--- + + + +# Data Source: aws_vpc_ipam_pool_cidrs + +`aws_vpc_ipam_pool_cidrs` provides details about an IPAM pool. + +This resource can prove useful when an ipam pool was shared to your account and you want to know all (or a filtered list) of the CIDRs that are provisioned into the pool. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_ipam_pool import DataAwsVpcIpamPool +from imports.aws.data_aws_vpc_ipam_pool_cidrs import DataAwsVpcIpamPoolCidrs +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + p = DataAwsVpcIpamPool(self, "p", + filter=[DataAwsVpcIpamPoolFilter( + name="description", + values=["*mypool*"] + ), DataAwsVpcIpamPoolFilter( + name="address-family", + values=["ipv4"] + ) + ] + ) + DataAwsVpcIpamPoolCidrs(self, "c", + ipam_pool_id=Token.as_string(p.id) + ) +``` + +Filtering: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformIterator, Fn, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_ipam_pool_cidrs import DataAwsVpcIpamPoolCidrs +from imports.aws.ec2_managed_prefix_list import Ec2ManagedPrefixList +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + c = DataAwsVpcIpamPoolCidrs(self, "c", + filter=[DataAwsVpcIpamPoolCidrsFilter( + name="cidr", + values=["10.*"] + ) + ], + ipam_pool_id="ipam-pool-123" + ) + mycidrs = "${[ for cidr in ${" + c.ipam_pool_cidrs + "} : cidr.cidr if cidr.state == \"provisioned\"]}" + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + pls_dynamic_iterator0 = TerraformIterator.from_list( + Token.as_any(mycidrs)) + Ec2ManagedPrefixList(self, "pls", + address_family="IPv4", + max_entries=Token.as_number(Fn.length_of(mycidrs)), + name="IPAM Pool (${" + test.id + "}) Cidrs", + entry=pls_dynamic_iterator0.dynamic({ + "cidr": pls_dynamic_iterator0.value, + "description": pls_dynamic_iterator0.value + }) + ) +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +VPCs in the current region. The given filters must match exactly one +VPC whose data will be exported as attributes. + +* `ipam_pool_id` - ID of the IPAM pool you would like the list of provisioned CIDRs. +* `filter` - Custom filter block as described below. + +## Attributes Reference + +All of the argument attributes except `filter` blocks are also exported as +result attributes. This data source will complete the data by populating +any fields that are not included in the configuration with the data for +the selected IPAM Pool CIDRs. + +The following attribute is additionally exported: + +* `ipam_pool_cidrs` - The CIDRs provisioned into the IPAM pool, described below. + +### ipam_pool_cidrs + +* `cidr` - A network CIDR. +* `state` - The provisioning state of that CIDR. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `1m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_ipam_pools.html.markdown b/website/docs/cdktf/python/d/vpc_ipam_pools.html.markdown new file mode 100644 index 00000000000..dd31e8588f9 --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_ipam_pools.html.markdown @@ -0,0 +1,83 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pools" +description: |- + Returns details about IPAM pools that match the search parameters provided. +--- + + + +# Data Source: aws_vpc_ipam_pools + +`aws_vpc_ipam_pools` provides details about IPAM pools. + +This resource can prove useful when IPAM pools are created in another root +module and you need the pool ids as input variables. For example, pools +can be shared via RAM and used to create vpcs with CIDRs from that pool. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_ipam_pools import DataAwsVpcIpamPools +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpcIpamPools(self, "test", + filter=[DataAwsVpcIpamPoolsFilter( + name="description", + values=["*test*"] + ), DataAwsVpcIpamPoolsFilter( + name="address-family", + values=["ipv4"] + ) + ] + ) +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +IPAM Pools in the current region. + +* `filter` - (Required) Custom filter block as described below. + +### filter + +* `name` - (Required) The name of the filter. Filter names are case-sensitive. +* `values` - (Required) The filter values. Filter values are case-sensitive. + +## Attributes Reference + +In addition to all of the arguments above, the following attributes are exported: + +* `ipam_pools` - List of IPAM pools and their attributes. See below for details + +### ipam_pools + +The following attributes are available on each pool entry found. + +* `address_family` - IP protocol assigned to this pool. +* `allocation_default_netmask_length` - A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is `10.0.0.0/8` and you enter 16 here, new allocations will default to `10.0.0.0/16`. +* `allocation_max_netmask_length` - The maximum netmask length that will be required for CIDR allocations in this pool. +* `allocation_min_netmask_length` - The minimum netmask length that will be required for CIDR allocations in this pool. +* `allocation_resource_tags` - Tags that are required to create resources in using this pool. +* `arn` - ARN of the pool +* `auto_import` - If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. +* `aws_service` - Limits which service in AWS that the pool can be used in. `ec2` for example, allows users to use space for Elastic IP addresses and VPCs. +* `description` - Description for the IPAM pool. +* `id` - ID of the IPAM pool. +* `ipam_scope_id` - ID of the scope the pool belongs to. +* `locale` - Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. +* `publicly_advertisable` - Defines whether or not IPv6 pool space is publicly advertisable over the internet. +* `source_ipam_pool_id` - ID of the source IPAM pool. +* `tags` - Map of tags to assigned to the resource. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_ipam_preview_next_cidr.html.markdown b/website/docs/cdktf/python/d/vpc_ipam_preview_next_cidr.html.markdown new file mode 100644 index 00000000000..d053476aa9f --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_ipam_preview_next_cidr.html.markdown @@ -0,0 +1,72 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_preview_next_cidr" +description: |- + Previews a CIDR from an IPAM address pool. +--- + + + +# Data Source: aws_vpc_ipam_preview_next_cidr + +Previews a CIDR from an IPAM address pool. Only works for private IPv4. + +~> **NOTE:** This functionality is also encapsulated in a resource sharing the same name. The data source can be used when you need to use the cidr in a calculation of the same Root module, `count` for example. However, once a cidr range has been allocated that was previewed, the next refresh will find a **new** cidr and may force new resources downstream. Make sure to use Terraform's lifecycle `ignore_changes` policy if this is undesirable. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from cdktf import TerraformResourceLifecycle +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_ipam_preview_next_cidr import DataAwsVpcIpamPreviewNextCidr +from imports.aws.vpc_ipam_pool_cidr_allocation import VpcIpamPoolCidrAllocation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = DataAwsVpcIpamPreviewNextCidr(self, "test", + depends_on=[aws_vpc_ipam_pool_cidr_test], + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_test.id), + netmask_length=28 + ) + aws_vpc_ipam_pool_cidr_allocation_test = VpcIpamPoolCidrAllocation(self, "test_1", + cidr=Token.as_string(test.cidr), + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_test.id), + lifecycle=TerraformResourceLifecycle( + ignore_changes=[cidr] + ) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_allocation_test.override_logical_id("test") +``` + +## Argument Reference + +The following arguments are supported: + +* `disallowed_cidrs` - (Optional) Exclude a particular CIDR range from being returned by the pool. +* `ipam_pool_id` - (Required) ID of the pool to which you want to assign a CIDR. +* `netmask_length` - (Optional) Netmask length of the CIDR you would like to preview from the IPAM pool. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `cidr` - Previewed CIDR from the pool. +* `id` - ID of the preview. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_peering_connection.html.markdown b/website/docs/cdktf/python/d/vpc_peering_connection.html.markdown new file mode 100644 index 00000000000..0edc99cd039 --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_peering_connection.html.markdown @@ -0,0 +1,114 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connection" +description: |- + Provides details about a specific VPC peering connection. +--- + + + +# Data Source: aws_vpc_peering_connection + +The VPC Peering Connection data source provides details about +a specific VPC peering connection. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_peering_connection import DataAwsVpcPeeringConnection +from imports.aws.route import Route +from imports.aws.route_table import RouteTable +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + rt = RouteTable(self, "rt", + vpc_id=foo.id + ) + pc = DataAwsVpcPeeringConnection(self, "pc", + peer_cidr_block="10.0.1.0/22", + vpc_id=foo.id + ) + Route(self, "r", + destination_cidr_block=Token.as_string(pc.peer_cidr_block), + route_table_id=rt.id, + vpc_peering_connection_id=Token.as_string(pc.id) + ) +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available VPC peering connection. +The given filters must match exactly one VPC peering connection whose data will be exported as attributes. + +* `id` - (Optional) ID of the specific VPC Peering Connection to retrieve. + +* `status` - (Optional) Status of the specific VPC Peering Connection to retrieve. + +* `vpc_id` - (Optional) ID of the requester VPC of the specific VPC Peering Connection to retrieve. + +* `owner_id` - (Optional) AWS account ID of the owner of the requester VPC of the specific VPC Peering Connection to retrieve. + +* `cidr_block` - (Optional) Primary CIDR block of the requester VPC of the specific VPC Peering Connection to retrieve. + +* `region` - (Optional) Region of the requester VPC of the specific VPC Peering Connection to retrieve. + +* `peer_vpc_id` - (Optional) ID of the accepter VPC of the specific VPC Peering Connection to retrieve. + +* `peer_owner_id` - (Optional) AWS account ID of the owner of the accepter VPC of the specific VPC Peering Connection to retrieve. + +* `peer_cidr_block` - (Optional) Primary CIDR block of the accepter VPC of the specific VPC Peering Connection to retrieve. + +* `peer_region` - (Optional) Region of the accepter VPC of the specific VPC Peering Connection to retrieve. + +* `filter` - (Optional) Custom filter block as described below. + +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the desired VPC Peering Connection. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcPeeringConnections.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC Peering Connection will be selected if any one of the given values matches. + +## Attributes Reference + +All of the argument attributes except `filter` are also exported as result attributes. + +* `accepter` - Configuration block that describes [VPC Peering Connection] +(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. + +* `cidr_block_set` - List of objects with CIDR blocks of the requester VPC. + +* `peer_cidr_block_set` - List of objects with CIDR blocks of the accepter VPC. + +* `requester` - Configuration block that describes [VPC Peering Connection] +(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. + +#### Accepter and Requester Attributes Reference + +* `allow_remote_vpc_dns_resolution` - Indicates whether a local VPC can resolve public DNS hostnames to +private IP addresses when queried from instances in a peer VPC. + +#### CIDR block set Attributes Reference + +* `cidr_block` - CIDR block associated to the VPC of the specific VPC Peering Connection. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_peering_connections.html.markdown b/website/docs/cdktf/python/d/vpc_peering_connections.html.markdown new file mode 100644 index 00000000000..cf1ede99bad --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_peering_connections.html.markdown @@ -0,0 +1,83 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connections" +description: |- + Lists peering connections +--- + + + +# Data Source: aws_vpc_peering_connections + +Use this data source to get IDs of Amazon VPC peering connections +To get more details on each connection, use the data resource [aws_vpc_peering_connection](/docs/providers/aws/d/vpc_peering_connection.html) + +Note: To use this data source in a count, the resources should exist before trying to access +the data source, as noted in [issue 4149](https://github.com/hashicorp/terraform/issues/4149) + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformCount, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_peering_connection import DataAwsVpcPeeringConnection +from imports.aws.data_aws_vpc_peering_connections import DataAwsVpcPeeringConnections +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + pcs = DataAwsVpcPeeringConnections(self, "pcs", + filter=[DataAwsVpcPeeringConnectionsFilter( + name="requester-vpc-info.vpc-id", + values=[foo.id] + ) + ] + ) + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + pc_count = TerraformCount.of(Token.as_number(Fn.length_of(pcs.ids))) + DataAwsVpcPeeringConnection(self, "pc", + id=Token.as_string(property_access(pcs.ids, [pc_count.index])), + count=pc_count + ) +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available VPC peering connections. + +* `filter` - (Optional) Custom filter block as described below. + +* `tags` - (Optional) Mapping of tags, each pair of which must exactly match + a pair on the desired VPC Peering Connection. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcPeeringConnections.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC Peering Connection will be selected if any one of the given values matches. + +## Attributes Reference + +All of the argument attributes except `filter` are also exported as result attributes. + +* `id` - AWS Region. +* `ids` - IDs of the VPC Peering Connections. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_security_group_rule.html.markdown b/website/docs/cdktf/python/d/vpc_security_group_rule.html.markdown new file mode 100644 index 00000000000..f3146c01ec9 --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_security_group_rule.html.markdown @@ -0,0 +1,67 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_security_group_rule" +description: |- + Provides details about a specific security group rule +--- + + + +# Data Source: aws_vpc_security_group_rule + +`aws_vpc_security_group_rule` provides details about a specific security group rule. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_security_group_rule import DataAwsVpcSecurityGroupRule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpcSecurityGroupRule(self, "example", + security_group_rule_id=security_group_rule_id.string_value + ) +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +security group rules. The given filters must match exactly one security group rule +whose data will be exported as attributes. + +* `security_group_rule_id` - (Optional) ID of the security group rule to select. +* `filter` - (Optional) Configuration block(s) for filtering. Detailed below. + +### filter Configuration Block + +The following arguments are supported by the `filter` configuration block: + +* `name` - (Required) Name of the filter field. Valid values can be found in the EC2 [`DescribeSecurityGroupRules`](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroupRules.html) API Reference. +* `values` - (Required) Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the security group rule. +* `cidr_ipv4` - The destination IPv4 CIDR range. +* `cidr_ipv6` - The destination IPv6 CIDR range. +* `description` - The security group rule description. +* `from_port` - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. +* `is_egress` - Indicates whether the security group rule is an outbound rule. +* `ip_protocol` - The IP protocol name or number. Use `-1` to specify all protocols. +* `prefix_list_id` - The ID of the destination prefix list. +* `referenced_security_group_id` - The destination security group that is referenced in the rule. +* `security_group_id` - The ID of the security group. +* `tags` - A map of tags assigned to the resource. +* `to_port` - (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpc_security_group_rules.html.markdown b/website/docs/cdktf/python/d/vpc_security_group_rules.html.markdown new file mode 100644 index 00000000000..89375f4b3ef --- /dev/null +++ b/website/docs/cdktf/python/d/vpc_security_group_rules.html.markdown @@ -0,0 +1,56 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_security_group_rules" +description: |- + Get information about a set of security group rules. +--- + + + +# Data Source: aws_vpc_security_group_rules + +This resource can be useful for getting back a set of security group rule IDs. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_security_group_rules import DataAwsVpcSecurityGroupRules +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpcSecurityGroupRules(self, "example", + filter=[DataAwsVpcSecurityGroupRulesFilter( + name="group-id", + values=[security_group_id.string_value] + ) + ] + ) +``` + +## Argument Reference + +* `filter` - (Optional) Custom filter block as described below. +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the desired security group rule. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroupRules.html). +* `values` - (Required) Set of values that are accepted for the given field. + Security group rule IDs will be selected if any one of the given values match. + +## Attributes Reference + +* `ids` - List of all the security group rule IDs found. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpclattice_auth_policy.html.markdown b/website/docs/cdktf/python/d/vpclattice_auth_policy.html.markdown new file mode 100644 index 00000000000..91ed217d504 --- /dev/null +++ b/website/docs/cdktf/python/d/vpclattice_auth_policy.html.markdown @@ -0,0 +1,49 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_auth_policy" +description: |- + Terraform data source for managing an AWS VPC Lattice Auth Policy. +--- + + + +# Data Source: aws_vpclattice_auth_policy + +Terraform data source for managing an AWS VPC Lattice Auth Policy. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpclattice_auth_policy import DataAwsVpclatticeAuthPolicy +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpclatticeAuthPolicy(self, "test", + resource_identifier=Token.as_string(aws_vpclattice_auth_policy_test.resource_identifier) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `resource_identifier` - (Required) The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `policy` - The auth policy. The policy string in JSON must not contain newlines or blank lines. +* `state` - The state of the auth policy. The auth policy is only active when the auth type is set to AWS_IAM. If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the Auth type is NONE, then, any auth policy you provide will remain inactive. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpclattice_listener.html.markdown b/website/docs/cdktf/python/d/vpclattice_listener.html.markdown new file mode 100644 index 00000000000..8842d7a8c26 --- /dev/null +++ b/website/docs/cdktf/python/d/vpclattice_listener.html.markdown @@ -0,0 +1,60 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_listener" +description: |- + Terraform data source for managing an AWS VPC Lattice Listener. +--- + + + +# Data Source: aws_vpclattice_listener + +Terraform data source for managing an AWS VPC Lattice Listener. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpclattice_listener import DataAwsVpclatticeListener +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, listenerIdentifier, serviceIdentifier): + super().__init__(scope, name) + DataAwsVpclatticeListener(self, "example", + listener_identifier=listener_identifier, + service_identifier=service_identifier + ) +``` + +## Argument Reference + +The following arguments are required: + +* `service_identifier` - (Required) ID or Amazon Resource Name (ARN) of the service network +* `listener_identifier` - (Required) ID or Amazon Resource Name (ARN) of the listener + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the listener. +* `created_at` - The date and time that the listener was created. +* `default_action` - The actions for the default listener rule. +* `last_updated_at` - The date and time the listener was last updated. +* `listener_id` - The ID of the listener. +* `name` - The name of the listener. +* `port` - The listener port. +* `protocol` - The listener protocol. Either `HTTPS` or `HTTP`. +* `service_arn` - The ARN of the service. +* `service_id` - The ID of the service. +* `tags` - List of tags associated with the listener. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpclattice_resource_policy.html.markdown b/website/docs/cdktf/python/d/vpclattice_resource_policy.html.markdown new file mode 100644 index 00000000000..4ab4db691ab --- /dev/null +++ b/website/docs/cdktf/python/d/vpclattice_resource_policy.html.markdown @@ -0,0 +1,48 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_resource_policy" +description: |- + Terraform data source for managing an AWS VPC Lattice Resource Policy. +--- + + + +# Data Source: aws_vpclattice_resource_policy + +Terraform data source for managing an AWS VPC Lattice Resource Policy. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpclattice_resource_policy import DataAwsVpclatticeResourcePolicy +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpclatticeResourcePolicy(self, "example", + resource_arn=Token.as_string(aws_vpclattice_service_network_example.arn) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `resource_arn` - (Required) Resource ARN of the resource for which a policy is retrieved. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `policy` - JSON-encoded string representation of the applied resource policy. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpclattice_service.html.markdown b/website/docs/cdktf/python/d/vpclattice_service.html.markdown new file mode 100644 index 00000000000..5d1600fd2d2 --- /dev/null +++ b/website/docs/cdktf/python/d/vpclattice_service.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service" +description: |- + Terraform data source for managing an AWS VPC Lattice Service. +--- + + + +# Data Source: aws_vpclattice_service + +Terraform data source for managing an AWS VPC Lattice Service. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpclattice_service import DataAwsVpclatticeService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, serviceIdentifier): + super().__init__(scope, name) + DataAwsVpclatticeService(self, "example", + service_identifier=service_identifier + ) +``` + +## Argument Reference + +The following arguments are required: + +* `service_identifier` - (Required) ID or Amazon Resource Name (ARN) of the service network + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the service. +* `auth_type` - Type of IAM policy. Either `NONE` or `AWS_IAM`. +* `certificate_arn` - Amazon Resource Name (ARN) of the certificate. +* `custom_domain_name` - Custom domain name of the service. +* `dns_entry` - DNS name of the service. +* `id` - Unique identifier for the service. +* `status` - Status of the service. +* `tags` - List of tags associated with the service. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpclattice_service_network.html.markdown b/website/docs/cdktf/python/d/vpclattice_service_network.html.markdown new file mode 100644 index 00000000000..e2d0fddd33a --- /dev/null +++ b/website/docs/cdktf/python/d/vpclattice_service_network.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service_network" +description: |- + Terraform data source for managing an AWS VPC Lattice Service Network. +--- + + + +# Data Source: aws_vpclattice_service_network + +Terraform data source for managing an AWS VPC Lattice Service Network. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpclattice_service_network import DataAwsVpclatticeServiceNetwork +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + DataAwsVpclatticeServiceNetwork(self, "example", + service_network_identifier="" + ) +``` + +## Argument Reference + +The following arguments are required: + +* `service_network_identifier` - (Required) Identifier of the network service. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the Service Network. +* `auth_type` - Authentication type for the service network. Either `NONE` or `AWS_IAM`. +* `created_at` - Date and time the service network was created. +* `id` - ID of the service network. +* `last_updated_at` - Date and time the service network was last updated. +* `name` - Name of the service network. +* `number_of_associated_services` - Number of services associated with this service network. +* `number_of_associated_vpcs` - Number of VPCs associated with this service network. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/d/vpcs.html.markdown b/website/docs/cdktf/python/d/vpcs.html.markdown new file mode 100644 index 00000000000..57fa4b09d42 --- /dev/null +++ b/website/docs/cdktf/python/d/vpcs.html.markdown @@ -0,0 +1,119 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpcs" +description: |- + Provides a list of VPC Ids in a region +--- + + + +# Data Source: aws_vpcs + +This resource can be useful for getting back a list of VPC Ids for a region. + +The following example retrieves a list of VPC Ids with a custom tag of `service` set to a value of "production". + +## Example Usage + +The following shows outputting all VPC Ids. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpcs import DataAwsVpcs +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + foo = DataAwsVpcs(self, "foo", + tags={ + "service": "production" + } + ) + cdktf_terraform_output_foo = TerraformOutput(self, "foo_1", + value=foo.ids + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + cdktf_terraform_output_foo.override_logical_id("foo") +``` + +An example use case would be interpolate the `aws_vpcs` output into `count` of an aws_flow_log resource. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformOutput, Fn, Token, TerraformCount, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc import DataAwsVpc +from imports.aws.data_aws_vpcs import DataAwsVpcs +from imports.aws.flow_log import FlowLog +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + foo = DataAwsVpcs(self, "foo") + cdktf_terraform_output_foo = TerraformOutput(self, "foo_1", + value=foo.ids + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + cdktf_terraform_output_foo.override_logical_id("foo") + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + foo_count = TerraformCount.of(Token.as_number(Fn.length_of(foo.ids))) + data_aws_vpc_foo = DataAwsVpc(self, "foo_2", + id=Token.as_string(property_access(Fn.tolist(foo.ids), [foo_count.index])), + count=foo_count + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_aws_vpc_foo.override_logical_id("foo") + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + test_flow_log_count = TerraformCount.of( + Token.as_number(Fn.length_of(foo.ids))) + FlowLog(self, "test_flow_log", + vpc_id=Token.as_string( + property_access( + property_access(data_aws_vpc_foo, [test_flow_log_count.index]), ["id"])), + count=test_flow_log_count + ) +``` + +## Argument Reference + +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the desired vpcs. + +* `filter` - (Optional) Custom filter block as described below. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC will be selected if any one of the given values matches. + +## Attributes Reference + +* `id` - AWS Region. +* `ids` - List of all the VPC Ids found. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20m`) + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_availability_zone_group.html.markdown b/website/docs/cdktf/python/r/ec2_availability_zone_group.html.markdown index 1b23003c61b..c41d1a12d71 100644 --- a/website/docs/cdktf/python/r/ec2_availability_zone_group.html.markdown +++ b/website/docs/cdktf/python/r/ec2_availability_zone_group.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Availability Zone Group. --- + + # Resource: aws_ec2_availability_zone_group Manages an EC2 Availability Zone Group, such as updating its opt-in status. @@ -15,15 +17,18 @@ Manages an EC2 Availability Zone Group, such as updating its opt-in status. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.ec2_availability_zone_group import Ec2AvailabilityZoneGroup +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.ec2_availability_zone_group.Ec2AvailabilityZoneGroup(self, "example", + Ec2AvailabilityZoneGroup(self, "example", group_name="us-west-2-lax-1", opt_in_status="opted-in" ) @@ -50,4 +55,4 @@ EC2 Availability Zone Groups can be imported using the group name, e.g., $ terraform import aws_ec2_availability_zone_group.example us-west-2-lax-1 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_capacity_reservation.html.markdown b/website/docs/cdktf/python/r/ec2_capacity_reservation.html.markdown index fea396044a8..23bb48777d2 100644 --- a/website/docs/cdktf/python/r/ec2_capacity_reservation.html.markdown +++ b/website/docs/cdktf/python/r/ec2_capacity_reservation.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an EC2 Capacity Reservation. This allows you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration. --- + + # Resource: aws_ec2_capacity_reservation Provides an EC2 Capacity Reservation. This allows you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration. @@ -13,15 +15,18 @@ Provides an EC2 Capacity Reservation. This allows you to reserve capacity for yo ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.ec2_capacity_reservation import Ec2CapacityReservation +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.ec2_capacity_reservation.Ec2CapacityReservation(self, "default", + Ec2CapacityReservation(self, "default", availability_zone="eu-west-1a", instance_count=1, instance_platform="Linux/UNIX", @@ -64,4 +69,4 @@ Capacity Reservations can be imported using the `id`, e.g., $ terraform import aws_ec2_capacity_reservation.web cr-0123456789abcdef0 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_carrier_gateway.html.markdown b/website/docs/cdktf/python/r/ec2_carrier_gateway.html.markdown index 93772d19dda..6c724ac5e09 100644 --- a/website/docs/cdktf/python/r/ec2_carrier_gateway.html.markdown +++ b/website/docs/cdktf/python/r/ec2_carrier_gateway.html.markdown @@ -6,20 +6,32 @@ description: |- Manages an EC2 Carrier Gateway. --- + + # Resource: aws_ec2_carrier_gateway Manages an EC2 Carrier Gateway. See the AWS [documentation](https://docs.aws.amazon.com/vpc/latest/userguide/Carrier_Gateway.html) for more information. ## Example Usage -```terraform -resource "aws_ec2_carrier_gateway" "example" { - vpc_id = aws_vpc.example.id - - tags = { - Name = "example-carrier-gateway" - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_carrier_gateway import Ec2CarrierGateway +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2CarrierGateway(self, "example", + tags={ + "Name": "example-carrier-gateway" + }, + vpc_id=Token.as_string(aws_vpc_example.id) + ) ``` ## Argument Reference @@ -47,4 +59,4 @@ e.g., $ terraform import aws_ec2_carrier_gateway.example cgw-12345 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_client_vpn_authorization_rule.html.markdown b/website/docs/cdktf/python/r/ec2_client_vpn_authorization_rule.html.markdown index 132561ee3c9..75f0922c1e6 100644 --- a/website/docs/cdktf/python/r/ec2_client_vpn_authorization_rule.html.markdown +++ b/website/docs/cdktf/python/r/ec2_client_vpn_authorization_rule.html.markdown @@ -6,6 +6,8 @@ description: |- Provides authorization rules for AWS Client VPN endpoints. --- + + # Resource: aws_ec2_client_vpn_authorization_rule Provides authorization rules for AWS Client VPN endpoints. For more information on usage, please see the @@ -13,12 +15,23 @@ Provides authorization rules for AWS Client VPN endpoints. For more information ## Example Usage -```terraform -resource "aws_ec2_client_vpn_authorization_rule" "example" { - client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id - target_network_cidr = aws_subnet.example.cidr_block - authorize_all_groups = true -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_client_vpn_authorization_rule import Ec2ClientVpnAuthorizationRule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2ClientVpnAuthorizationRule(self, "example", + authorize_all_groups=True, + client_vpn_endpoint_id=Token.as_string(aws_ec2_client_vpn_endpoint_example.id), + target_network_cidr=Token.as_string(aws_subnet_example.cidr_block) + ) ``` ## Argument Reference @@ -54,4 +67,4 @@ $ terraform import aws_ec2_client_vpn_authorization_rule.example cvpn-endpoint-0 $ terraform import aws_ec2_client_vpn_authorization_rule.example cvpn-endpoint-0ac3a1abbccddd666,10.1.0.0/24,team-a ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_client_vpn_endpoint.html.markdown b/website/docs/cdktf/python/r/ec2_client_vpn_endpoint.html.markdown index d950ed10bd2..eb6c7963d40 100644 --- a/website/docs/cdktf/python/r/ec2_client_vpn_endpoint.html.markdown +++ b/website/docs/cdktf/python/r/ec2_client_vpn_endpoint.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an AWS Client VPN endpoint for OpenVPN clients. --- + + # Resource: aws_ec2_client_vpn_endpoint Provides an AWS Client VPN endpoint for OpenVPN clients. For more information on usage, please see the @@ -13,23 +15,33 @@ Provides an AWS Client VPN endpoint for OpenVPN clients. For more information on ## Example Usage -```terraform -resource "aws_ec2_client_vpn_endpoint" "example" { - description = "terraform-clientvpn-example" - server_certificate_arn = aws_acm_certificate.cert.arn - client_cidr_block = "10.0.0.0/16" - - authentication_options { - type = "certificate-authentication" - root_certificate_chain_arn = aws_acm_certificate.root_cert.arn - } - - connection_log_options { - enabled = true - cloudwatch_log_group = aws_cloudwatch_log_group.lg.name - cloudwatch_log_stream = aws_cloudwatch_log_stream.ls.name - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_client_vpn_endpoint import Ec2ClientVpnEndpoint +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2ClientVpnEndpoint(self, "example", + authentication_options=[Ec2ClientVpnEndpointAuthenticationOptions( + root_certificate_chain_arn=root_cert.arn, + type="certificate-authentication" + ) + ], + client_cidr_block="10.0.0.0/16", + connection_log_options=Ec2ClientVpnEndpointConnectionLogOptions( + cloudwatch_log_group=lg.name, + cloudwatch_log_stream=ls.name, + enabled=True + ), + description="terraform-clientvpn-example", + server_certificate_arn=cert.arn + ) ``` ## Argument Reference @@ -98,4 +110,4 @@ AWS Client VPN endpoints can be imported using the `id` value found via `aws ec2 $ terraform import aws_ec2_client_vpn_endpoint.example cvpn-endpoint-0ac3a1abbccddd666 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_client_vpn_network_association.html.markdown b/website/docs/cdktf/python/r/ec2_client_vpn_network_association.html.markdown index 089c77dbb88..03694af8181 100644 --- a/website/docs/cdktf/python/r/ec2_client_vpn_network_association.html.markdown +++ b/website/docs/cdktf/python/r/ec2_client_vpn_network_association.html.markdown @@ -6,6 +6,8 @@ description: |- Provides network associations for AWS Client VPN endpoints. --- + + # Resource: aws_ec2_client_vpn_network_association Provides network associations for AWS Client VPN endpoints. For more information on usage, please see the @@ -13,11 +15,22 @@ Provides network associations for AWS Client VPN endpoints. For more information ## Example Usage -```terraform -resource "aws_ec2_client_vpn_network_association" "example" { - client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id - subnet_id = aws_subnet.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_client_vpn_network_association import Ec2ClientVpnNetworkAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2ClientVpnNetworkAssociation(self, "example", + client_vpn_endpoint_id=Token.as_string(aws_ec2_client_vpn_endpoint_example.id), + subnet_id=Token.as_string(aws_subnet_example.id) + ) ``` ## Argument Reference @@ -50,4 +63,4 @@ AWS Client VPN network associations can be imported using the endpoint ID and th $ terraform import aws_ec2_client_vpn_network_association.example cvpn-endpoint-0ac3a1abbccddd666,vpn-assoc-0b8db902465d069ad ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_client_vpn_route.html.markdown b/website/docs/cdktf/python/r/ec2_client_vpn_route.html.markdown index eed51fdd474..e2e7e57f090 100644 --- a/website/docs/cdktf/python/r/ec2_client_vpn_route.html.markdown +++ b/website/docs/cdktf/python/r/ec2_client_vpn_route.html.markdown @@ -6,6 +6,8 @@ description: |- Provides additional routes for AWS Client VPN endpoints. --- + + # Resource: aws_ec2_client_vpn_route Provides additional routes for AWS Client VPN endpoints. For more information on usage, please see the @@ -13,32 +15,47 @@ Provides additional routes for AWS Client VPN endpoints. For more information on ## Example Usage -```terraform -resource "aws_ec2_client_vpn_route" "example" { - client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id - destination_cidr_block = "0.0.0.0/0" - target_vpc_subnet_id = aws_ec2_client_vpn_network_association.example.subnet_id -} - -resource "aws_ec2_client_vpn_network_association" "example" { - client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id - subnet_id = aws_subnet.example.id -} - -resource "aws_ec2_client_vpn_endpoint" "example" { - description = "Example Client VPN endpoint" - server_certificate_arn = aws_acm_certificate.example.arn - client_cidr_block = "10.0.0.0/16" - - authentication_options { - type = "certificate-authentication" - root_certificate_chain_arn = aws_acm_certificate.example.arn - } - - connection_log_options { - enabled = false - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_client_vpn_endpoint import Ec2ClientVpnEndpoint +from imports.aws.ec2_client_vpn_network_association import Ec2ClientVpnNetworkAssociation +from imports.aws.ec2_client_vpn_route import Ec2ClientVpnRoute +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Ec2ClientVpnEndpoint(self, "example", + authentication_options=[Ec2ClientVpnEndpointAuthenticationOptions( + root_certificate_chain_arn=Token.as_string(aws_acm_certificate_example.arn), + type="certificate-authentication" + ) + ], + client_cidr_block="10.0.0.0/16", + connection_log_options=Ec2ClientVpnEndpointConnectionLogOptions( + enabled=False + ), + description="Example Client VPN endpoint", + server_certificate_arn=Token.as_string(aws_acm_certificate_example.arn) + ) + aws_ec2_client_vpn_network_association_example = + Ec2ClientVpnNetworkAssociation(self, "example_1", + client_vpn_endpoint_id=example.id, + subnet_id=Token.as_string(aws_subnet_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_ec2_client_vpn_network_association_example.override_logical_id("example") + aws_ec2_client_vpn_route_example = Ec2ClientVpnRoute(self, "example_2", + client_vpn_endpoint_id=example.id, + destination_cidr_block="0.0.0.0/0", + target_vpc_subnet_id=Token.as_string(aws_ec2_client_vpn_network_association_example.subnet_id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_ec2_client_vpn_route_example.override_logical_id("example") ``` ## Argument Reference @@ -73,4 +90,4 @@ AWS Client VPN routes can be imported using the endpoint ID, target subnet ID, a $ terraform import aws_ec2_client_vpn_route.example cvpn-endpoint-1234567890abcdef,subnet-9876543210fedcba,10.1.0.0/24 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_fleet.html.markdown b/website/docs/cdktf/python/r/ec2_fleet.html.markdown index 2cac1b0a692..eeae5e5a1be 100644 --- a/website/docs/cdktf/python/r/ec2_fleet.html.markdown +++ b/website/docs/cdktf/python/r/ec2_fleet.html.markdown @@ -6,26 +6,39 @@ description: |- Provides a resource to manage EC2 Fleets --- + + # Resource: aws_ec2_fleet Provides a resource to manage EC2 Fleets. ## Example Usage -```terraform -resource "aws_ec2_fleet" "example" { - launch_template_config { - launch_template_specification { - launch_template_id = aws_launch_template.example.id - version = aws_launch_template.example.latest_version - } - } - - target_capacity_specification { - default_target_capacity_type = "spot" - total_target_capacity = 5 - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_fleet import Ec2Fleet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2Fleet(self, "example", + launch_template_config=[Ec2FleetLaunchTemplateConfig( + launch_template_specification=Ec2FleetLaunchTemplateConfigLaunchTemplateSpecification( + launch_template_id=Token.as_string(aws_launch_template_example.id), + version=Token.as_string(aws_launch_template_example.latest_version) + ) + ) + ], + target_capacity_specification=Ec2FleetTargetCapacitySpecification( + default_target_capacity_type="spot", + total_target_capacity=5 + ) + ) ``` ## Argument Reference @@ -67,24 +80,32 @@ Any parameters that you specify override the same parameters in the launch templ Example: -```terraform -resource "aws_ec2_fleet" "example" { - # ... other configuration ... - - launch_template_config { - # ... other configuration ... - - override { - instance_type = "m4.xlarge" - weighted_capacity = 1 - } - - override { - instance_type = "m4.2xlarge" - weighted_capacity = 2 - } - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_fleet import Ec2Fleet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, targetCapacitySpecification): + super().__init__(scope, name) + Ec2Fleet(self, "example", + launch_template_config=[Ec2FleetLaunchTemplateConfig( + override=[Ec2FleetLaunchTemplateConfigOverride( + instance_type="m4.xlarge", + weighted_capacity=1 + ), Ec2FleetLaunchTemplateConfigOverride( + instance_type="m4.2xlarge", + weighted_capacity=2 + ) + ] + ) + ], + target_capacity_specification=target_capacity_specification + ) ``` * `availability_zone` - (Optional) Availability Zone in which to launch the instances. @@ -231,4 +252,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_fleet.example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080c ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_host.html.markdown b/website/docs/cdktf/python/r/ec2_host.html.markdown index 46583ee083d..3d544fd6c99 100644 --- a/website/docs/cdktf/python/r/ec2_host.html.markdown +++ b/website/docs/cdktf/python/r/ec2_host.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an EC2 Host resource. This allows Dedicated Hosts to be allocated, modified, and released. --- + + # Resource: aws_ec2_host Provides an EC2 Host resource. This allows Dedicated Hosts to be allocated, modified, and released. @@ -13,15 +15,18 @@ Provides an EC2 Host resource. This allows Dedicated Hosts to be allocated, modi ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.ec2_host import Ec2Host +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.ec2_host.Ec2Host(self, "test", + Ec2Host(self, "test", auto_placement="on", availability_zone="us-west-2a", host_recovery="on", @@ -58,4 +63,4 @@ Hosts can be imported using the host `id`, e.g., $ terraform import aws_ec2_host.example h-0385a99d0e4b20cbb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_instance_state.html.markdown b/website/docs/cdktf/python/r/ec2_instance_state.html.markdown index 01da15e39d7..89d7e2c157e 100644 --- a/website/docs/cdktf/python/r/ec2_instance_state.html.markdown +++ b/website/docs/cdktf/python/r/ec2_instance_state.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an EC2 instance state resource. This allows managing an instance power state. --- + + # Resource: aws_ec2_instance_state Provides an EC2 instance state resource. This allows managing an instance power state. @@ -15,15 +17,20 @@ Provides an EC2 instance state resource. This allows managing an instance power ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ami import DataAwsAmi +from imports.aws.ec2_instance_state import Ec2InstanceState +from imports.aws.instance import Instance +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - data_aws_ami_ubuntu = aws.data_aws_ami.DataAwsAmi(self, "ubuntu", + ubuntu = DataAwsAmi(self, "ubuntu", filter=[DataAwsAmiFilter( name="name", values=["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] @@ -35,15 +42,15 @@ class MyConvertedCode(cdktf.TerraformStack): most_recent=True, owners=["099720109477"] ) - aws_instance_test = aws.instance.Instance(self, "test", - ami=cdktf.Token.as_string(data_aws_ami_ubuntu.id), + test = Instance(self, "test", + ami=Token.as_string(ubuntu.id), instance_type="t3.micro", tags={ "Name": "HelloWorld" } ) - aws_ec2_instance_state_test = aws.ec2_instance_state.Ec2InstanceState(self, "test_2", - instance_id=cdktf.Token.as_string(aws_instance_test.id), + aws_ec2_instance_state_test = Ec2InstanceState(self, "test_2", + instance_id=test.id, state="stopped" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -83,4 +90,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_instance_state.test i-02cae6557dfcf2f96 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_local_gateway_route.html.markdown b/website/docs/cdktf/python/r/ec2_local_gateway_route.html.markdown index 815dec7e437..a164c4409eb 100644 --- a/website/docs/cdktf/python/r/ec2_local_gateway_route.html.markdown +++ b/website/docs/cdktf/python/r/ec2_local_gateway_route.html.markdown @@ -6,18 +6,31 @@ description: |- Manages an EC2 Local Gateway Route --- + + # Resource: aws_ec2_local_gateway_route Manages an EC2 Local Gateway Route. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing). ## Example Usage -```terraform -resource "aws_ec2_local_gateway_route" "example" { - destination_cidr_block = "172.16.0.0/16" - local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.example.id - local_gateway_virtual_interface_group_id = data.aws_ec2_local_gateway_virtual_interface_group.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_local_gateway_route import Ec2LocalGatewayRoute +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2LocalGatewayRoute(self, "example", + destination_cidr_block="172.16.0.0/16", + local_gateway_route_table_id=Token.as_string(data_aws_ec2_local_gateway_route_table_example.id), + local_gateway_virtual_interface_group_id=Token.as_string(data_aws_ec2_local_gateway_virtual_interface_group_example.id) + ) ``` ## Argument Reference @@ -42,4 +55,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_local_gateway_route.example lgw-rtb-12345678_172.16.0.0/16 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_local_gateway_route_table_vpc_association.html.markdown b/website/docs/cdktf/python/r/ec2_local_gateway_route_table_vpc_association.html.markdown index 842b4f5b10b..adfba7f2d6f 100644 --- a/website/docs/cdktf/python/r/ec2_local_gateway_route_table_vpc_association.html.markdown +++ b/website/docs/cdktf/python/r/ec2_local_gateway_route_table_vpc_association.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Local Gateway Route Table VPC Association --- + + # Resource: aws_ec2_local_gateway_route_table_vpc_association Manages an EC2 Local Gateway Route Table VPC Association. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-local-gateways.html#vpc-associations). @@ -13,27 +15,32 @@ Manages an EC2 Local Gateway Route Table VPC Association. More information can b ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ec2_local_gateway_route_table import DataAwsEc2LocalGatewayRouteTable +from imports.aws.ec2_local_gateway_route_table_vpc_association import Ec2LocalGatewayRouteTableVpcAssociation +from imports.aws.vpc import Vpc +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws_vpc_example = aws.vpc.Vpc(self, "example", + example = Vpc(self, "example", cidr_block="10.0.0.0/16" ) data_aws_ec2_local_gateway_route_table_example = - aws.data_aws_ec2_local_gateway_route_table.DataAwsEc2LocalGatewayRouteTable(self, "example_1", + DataAwsEc2LocalGatewayRouteTable(self, "example_1", outpost_arn="arn:aws:outposts:us-west-2:123456789012:outpost/op-1234567890abcdef" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_aws_ec2_local_gateway_route_table_example.override_logical_id("example") aws_ec2_local_gateway_route_table_vpc_association_example = - aws.ec2_local_gateway_route_table_vpc_association.Ec2LocalGatewayRouteTableVpcAssociation(self, "example_2", - local_gateway_route_table_id=cdktf.Token.as_string(data_aws_ec2_local_gateway_route_table_example.id), - vpc_id=cdktf.Token.as_string(aws_vpc_example.id) + Ec2LocalGatewayRouteTableVpcAssociation(self, "example_2", + local_gateway_route_table_id=Token.as_string(data_aws_ec2_local_gateway_route_table_example.id), + vpc_id=example.id ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. aws_ec2_local_gateway_route_table_vpc_association_example.override_logical_id("example") @@ -65,4 +72,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_local_gateway_route_table_vpc_association.example lgw-vpc-assoc-1234567890abcdef ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_managed_prefix_list.html.markdown b/website/docs/cdktf/python/r/ec2_managed_prefix_list.html.markdown index 304664078e6..34673ccec5f 100644 --- a/website/docs/cdktf/python/r/ec2_managed_prefix_list.html.markdown +++ b/website/docs/cdktf/python/r/ec2_managed_prefix_list.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a managed prefix list resource. --- + + # Resource: aws_ec2_managed_prefix_list Provides a managed prefix list resource. @@ -26,26 +28,34 @@ as 20 rules for the security group. Basic usage -```terraform -resource "aws_ec2_managed_prefix_list" "example" { - name = "All VPC CIDR-s" - address_family = "IPv4" - max_entries = 5 - - entry { - cidr = aws_vpc.example.cidr_block - description = "Primary" - } - - entry { - cidr = aws_vpc_ipv4_cidr_block_association.example.cidr_block - description = "Secondary" - } - - tags = { - Env = "live" - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_managed_prefix_list import Ec2ManagedPrefixList +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2ManagedPrefixList(self, "example", + address_family="IPv4", + entry=[Ec2ManagedPrefixListEntry( + cidr=Token.as_string(aws_vpc_example.cidr_block), + description="Primary" + ), Ec2ManagedPrefixListEntry( + cidr=Token.as_string(aws_vpc_ipv4_cidr_block_association_example.cidr_block), + description="Secondary" + ) + ], + max_entries=5, + name="All VPC CIDR-s", + tags={ + "Env": "live" + } + ) ``` ## Argument Reference @@ -81,4 +91,4 @@ Prefix Lists can be imported using the `id`, e.g., $ terraform import aws_ec2_managed_prefix_list.default pl-0570a1d2d725c16be ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_managed_prefix_list_entry.html.markdown b/website/docs/cdktf/python/r/ec2_managed_prefix_list_entry.html.markdown index 2c2617cd846..19da23afbac 100644 --- a/website/docs/cdktf/python/r/ec2_managed_prefix_list_entry.html.markdown +++ b/website/docs/cdktf/python/r/ec2_managed_prefix_list_entry.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a managed prefix list entry resource. --- + + # Resource: aws_ec2_managed_prefix_list_entry Provides a managed prefix list entry resource. @@ -26,22 +28,32 @@ resource instead. Basic usage -```terraform -resource "aws_ec2_managed_prefix_list" "example" { - name = "All VPC CIDR-s" - address_family = "IPv4" - max_entries = 5 - - tags = { - Env = "live" - } -} - -resource "aws_ec2_managed_prefix_list_entry" "entry_1" { - cidr = aws_vpc.example.cidr_block - description = "Primary" - prefix_list_id = aws_ec2_managed_prefix_list.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_managed_prefix_list import Ec2ManagedPrefixList +from imports.aws.ec2_managed_prefix_list_entry import Ec2ManagedPrefixListEntryA +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Ec2ManagedPrefixList(self, "example", + address_family="IPv4", + max_entries=5, + name="All VPC CIDR-s", + tags={ + "Env": "live" + } + ) + Ec2ManagedPrefixListEntryA(self, "entry_1", + cidr=Token.as_string(aws_vpc_example.cidr_block), + description="Primary", + prefix_list_id=example.id + ) ``` ## Argument Reference @@ -66,4 +78,4 @@ Prefix List Entries can be imported using the `prefix_list_id` and `cidr` separa $ terraform import aws_ec2_managed_prefix_list_entry.default pl-0570a1d2d725c16be,10.0.3.0/24 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_network_insights_analysis.html.markdown b/website/docs/cdktf/python/r/ec2_network_insights_analysis.html.markdown index 74ecc094ad2..bffa594940f 100644 --- a/website/docs/cdktf/python/r/ec2_network_insights_analysis.html.markdown +++ b/website/docs/cdktf/python/r/ec2_network_insights_analysis.html.markdown @@ -6,22 +6,35 @@ description: |- Provides a Network Insights Analysis resource. --- + + # Resource: aws_ec2_network_insights_analysis Provides a Network Insights Analysis resource. Part of the "Reachability Analyzer" service in the AWS VPC console. ## Example Usage -```terraform -resource "aws_ec2_network_insights_path" "path" { - source = aws_network_interface.source.id - destination = aws_network_interface.destination.id - protocol = "tcp" -} - -resource "aws_ec2_network_insights_analysis" "analysis" { - network_insights_path_id = aws_ec2_network_insights_path.path.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_network_insights_analysis import Ec2NetworkInsightsAnalysis +from imports.aws.ec2_network_insights_path import Ec2NetworkInsightsPath +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + path = Ec2NetworkInsightsPath(self, "path", + destination=destination.id, + protocol="tcp", + source=source.id + ) + Ec2NetworkInsightsAnalysis(self, "analysis", + network_insights_path_id=path.id + ) ``` ## Argument Reference @@ -66,4 +79,4 @@ Network Insights Analyses can be imported using the `id`, e.g., $ terraform import aws_ec2_network_insights_analysis.test nia-0462085c957f11a55 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_network_insights_path.html.markdown b/website/docs/cdktf/python/r/ec2_network_insights_path.html.markdown index 2b0b1ba32fa..dff190eb7eb 100644 --- a/website/docs/cdktf/python/r/ec2_network_insights_path.html.markdown +++ b/website/docs/cdktf/python/r/ec2_network_insights_path.html.markdown @@ -6,18 +6,31 @@ description: |- Provides a Network Insights Path resource. --- + + # Resource: aws_ec2_network_insights_path Provides a Network Insights Path resource. Part of the "Reachability Analyzer" service in the AWS VPC console. ## Example Usage -```terraform -resource "aws_ec2_network_insights_path" "test" { - source = aws_network_interface.source.id - destination = aws_network_interface.destination.id - protocol = "tcp" -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_network_insights_path import Ec2NetworkInsightsPath +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2NetworkInsightsPath(self, "test", + destination=destination.id, + protocol="tcp", + source=source.id + ) ``` ## Argument Reference @@ -51,4 +64,4 @@ Network Insights Paths can be imported using the `id`, e.g., $ terraform import aws_ec2_network_insights_path.test nip-00edfba169923aefd ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_serial_console_access.html.markdown b/website/docs/cdktf/python/r/ec2_serial_console_access.html.markdown index 10586885f97..1f481ae4a19 100644 --- a/website/docs/cdktf/python/r/ec2_serial_console_access.html.markdown +++ b/website/docs/cdktf/python/r/ec2_serial_console_access.html.markdown @@ -6,6 +6,8 @@ description: |- Manages whether serial console access is enabled for your AWS account in the current AWS region. --- + + # Resource: aws_ec2_serial_console_access Provides a resource to manage whether serial console access is enabled for your AWS account in the current AWS region. @@ -15,15 +17,18 @@ Provides a resource to manage whether serial console access is enabled for your ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.ec2_serial_console_access import Ec2SerialConsoleAccess +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.ec2_serial_console_access.Ec2SerialConsoleAccess(self, "example", + Ec2SerialConsoleAccess(self, "example", enabled=True ) ``` @@ -46,4 +51,4 @@ Serial console access state can be imported, e.g., $ terraform import aws_ec2_serial_console_access.example default ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_subnet_cidr_reservation.html.markdown b/website/docs/cdktf/python/r/ec2_subnet_cidr_reservation.html.markdown index 059efaf893e..3e079c505d9 100644 --- a/website/docs/cdktf/python/r/ec2_subnet_cidr_reservation.html.markdown +++ b/website/docs/cdktf/python/r/ec2_subnet_cidr_reservation.html.markdown @@ -6,18 +6,31 @@ description: |- Provides a subnet CIDR reservation resource. --- + + # Resource: aws_ec2_subnet_cidr_reservation Provides a subnet CIDR reservation resource. ## Example Usage -```terraform -resource "aws_ec2_subnet_cidr_reservation" "example" { - cidr_block = "10.0.0.16/28" - reservation_type = "prefix" - subnet_id = aws_subnet.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_subnet_cidr_reservation import Ec2SubnetCidrReservation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2SubnetCidrReservation(self, "example", + cidr_block="10.0.0.16/28", + reservation_type="prefix", + subnet_id=Token.as_string(aws_subnet_example.id) + ) ``` ## Argument Reference @@ -44,4 +57,4 @@ Existing CIDR reservations can be imported using `SUBNET_ID:RESERVATION_ID`, e.g $ terraform import aws_ec2_subnet_cidr_reservation.example subnet-01llsxvsxabqiymcz:scr-4mnvz6wb7otksjcs9 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_tag.html.markdown b/website/docs/cdktf/python/r/ec2_tag.html.markdown index 15b700f40d9..83c43234b22 100644 --- a/website/docs/cdktf/python/r/ec2_tag.html.markdown +++ b/website/docs/cdktf/python/r/ec2_tag.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an individual EC2 resource tag --- + + # Resource: aws_ec2_tag Manages an individual EC2 resource tag. This resource should only be used in cases where EC2 resources are created outside Terraform (e.g., AMIs), being shared via Resource Access Manager (RAM), or implicitly created by other means (e.g., Transit Gateway VPN Attachments). @@ -17,33 +19,38 @@ Manages an individual EC2 resource tag. This resource should only be used in cas ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.customer_gateway import CustomerGateway +from imports.aws.ec2_tag import Ec2Tag +from imports.aws.ec2_transit_gateway import Ec2TransitGateway +from imports.aws.vpn_connection import VpnConnection +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws_customer_gateway_example = aws.customer_gateway.CustomerGateway(self, "example", - bgp_asn=cdktf.Token.as_string(65000), + example = CustomerGateway(self, "example", + bgp_asn=Token.as_string(65000), ip_address="172.0.0.1", type="ipsec.1" ) - aws_ec2_transit_gateway_example = - aws.ec2_transit_gateway.Ec2TransitGateway(self, "example_1") + aws_ec2_transit_gateway_example = Ec2TransitGateway(self, "example_1") # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. aws_ec2_transit_gateway_example.override_logical_id("example") - aws_vpn_connection_example = aws.vpn_connection.VpnConnection(self, "example_2", - customer_gateway_id=cdktf.Token.as_string(aws_customer_gateway_example.id), - transit_gateway_id=cdktf.Token.as_string(aws_ec2_transit_gateway_example.id), - type=cdktf.Token.as_string(aws_customer_gateway_example.type) + aws_vpn_connection_example = VpnConnection(self, "example_2", + customer_gateway_id=example.id, + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id), + type=example.type ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. aws_vpn_connection_example.override_logical_id("example") - aws_ec2_tag_example = aws.ec2_tag.Ec2Tag(self, "example_3", + aws_ec2_tag_example = Ec2Tag(self, "example_3", key="Name", - resource_id=cdktf.Token.as_string(aws_vpn_connection_example.transit_gateway_attachment_id), + resource_id=Token.as_string(aws_vpn_connection_example.transit_gateway_attachment_id), value="Hello World" ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. @@ -72,4 +79,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_tag.example tgw-attach-1234567890abcdef,Name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_traffic_mirror_filter.html.markdown b/website/docs/cdktf/python/r/ec2_traffic_mirror_filter.html.markdown index 1fc8bf46f48..598a8626cac 100644 --- a/website/docs/cdktf/python/r/ec2_traffic_mirror_filter.html.markdown +++ b/website/docs/cdktf/python/r/ec2_traffic_mirror_filter.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an Traffic mirror filter --- + + # Resource: aws_ec2_traffic_mirror_filter Provides an Traffic mirror filter. @@ -16,15 +18,18 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror filter ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.ec2_traffic_mirror_filter import Ec2TrafficMirrorFilter +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.ec2_traffic_mirror_filter.Ec2TrafficMirrorFilter(self, "foo", + Ec2TrafficMirrorFilter(self, "foo", description="traffic mirror filter - terraform example", network_services=["amazon-dns"] ) @@ -54,4 +59,4 @@ Traffic mirror filter can be imported using the `id`, e.g., $ terraform import aws_ec2_traffic_mirror_filter.foo tmf-0fbb93ddf38198f64 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_traffic_mirror_filter_rule.html.markdown b/website/docs/cdktf/python/r/ec2_traffic_mirror_filter_rule.html.markdown index 86094c8e80c..9fe692c36a6 100644 --- a/website/docs/cdktf/python/r/ec2_traffic_mirror_filter_rule.html.markdown +++ b/website/docs/cdktf/python/r/ec2_traffic_mirror_filter_rule.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an Traffic mirror filter rule --- + + # Resource: aws_ec2_traffic_mirror_filter_rule Provides an Traffic mirror filter rule. @@ -16,20 +18,23 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.ec2_traffic_mirror_filter import Ec2TrafficMirrorFilter +from imports.aws.ec2_traffic_mirror_filter_rule import Ec2TrafficMirrorFilterRule +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws_ec2_traffic_mirror_filter_filter = - aws.ec2_traffic_mirror_filter.Ec2TrafficMirrorFilter(self, "filter", + filter = Ec2TrafficMirrorFilter(self, "filter", description="traffic mirror filter - terraform example", network_services=["amazon-dns"] ) - aws.ec2_traffic_mirror_filter_rule.Ec2TrafficMirrorFilterRule(self, "rulein", + Ec2TrafficMirrorFilterRule(self, "rulein", description="test rule", destination_cidr_block="10.0.0.0/8", destination_port_range=Ec2TrafficMirrorFilterRuleDestinationPortRange( @@ -45,16 +50,16 @@ class MyConvertedCode(cdktf.TerraformStack): to_port=10 ), traffic_direction="ingress", - traffic_mirror_filter_id=cdktf.Token.as_string(aws_ec2_traffic_mirror_filter_filter.id) + traffic_mirror_filter_id=filter.id ) - aws.ec2_traffic_mirror_filter_rule.Ec2TrafficMirrorFilterRule(self, "ruleout", + Ec2TrafficMirrorFilterRule(self, "ruleout", description="test rule", destination_cidr_block="10.0.0.0/8", rule_action="accept", rule_number=1, source_cidr_block="10.0.0.0/8", traffic_direction="egress", - traffic_mirror_filter_id=cdktf.Token.as_string(aws_ec2_traffic_mirror_filter_filter.id) + traffic_mirror_filter_id=filter.id ) ``` @@ -93,4 +98,4 @@ Traffic mirror rules can be imported using the `traffic_mirror_filter_id` and `i $ terraform import aws_ec2_traffic_mirror_filter_rule.rule tmf-0fbb93ddf38198f64:tmfr-05a458f06445d0aee ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_traffic_mirror_session.html.markdown b/website/docs/cdktf/python/r/ec2_traffic_mirror_session.html.markdown index 58b0d2dc980..533f2d9435f 100644 --- a/website/docs/cdktf/python/r/ec2_traffic_mirror_session.html.markdown +++ b/website/docs/cdktf/python/r/ec2_traffic_mirror_session.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a Traffic mirror session --- + + # Resource: aws_ec2_traffic_mirror_session Provides an Traffic mirror session. @@ -15,23 +17,34 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session -```terraform -resource "aws_ec2_traffic_mirror_filter" "filter" { - description = "traffic mirror filter - terraform example" - network_services = ["amazon-dns"] -} - -resource "aws_ec2_traffic_mirror_target" "target" { - network_load_balancer_arn = aws_lb.lb.arn -} - -resource "aws_ec2_traffic_mirror_session" "session" { - description = "traffic mirror session - terraform example" - network_interface_id = aws_instance.test.primary_network_interface_id - session_number = 1 - traffic_mirror_filter_id = aws_ec2_traffic_mirror_filter.filter.id - traffic_mirror_target_id = aws_ec2_traffic_mirror_target.target.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_traffic_mirror_filter import Ec2TrafficMirrorFilter +from imports.aws.ec2_traffic_mirror_session import Ec2TrafficMirrorSession +from imports.aws.ec2_traffic_mirror_target import Ec2TrafficMirrorTarget +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + filter = Ec2TrafficMirrorFilter(self, "filter", + description="traffic mirror filter - terraform example", + network_services=["amazon-dns"] + ) + target = Ec2TrafficMirrorTarget(self, "target", + network_load_balancer_arn=lb.arn + ) + Ec2TrafficMirrorSession(self, "session", + description="traffic mirror session - terraform example", + network_interface_id=test.primary_network_interface_id, + session_number=1, + traffic_mirror_filter_id=filter.id, + traffic_mirror_target_id=target.id + ) ``` ## Argument Reference @@ -64,4 +77,4 @@ Traffic mirror sessions can be imported using the `id`, e.g., $ terraform import aws_ec2_traffic_mirror_session.session tms-0d8aa3ca35897b82e ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_traffic_mirror_target.html.markdown b/website/docs/cdktf/python/r/ec2_traffic_mirror_target.html.markdown index a926f203af1..45d7cf5544d 100644 --- a/website/docs/cdktf/python/r/ec2_traffic_mirror_target.html.markdown +++ b/website/docs/cdktf/python/r/ec2_traffic_mirror_target.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a Traffic mirror target --- + + # Resource: aws_ec2_traffic_mirror_target Provides a Traffic mirror target. @@ -15,21 +17,30 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session -```terraform -resource "aws_ec2_traffic_mirror_target" "nlb" { - description = "NLB target" - network_load_balancer_arn = aws_lb.lb.arn -} - -resource "aws_ec2_traffic_mirror_target" "eni" { - description = "ENI target" - network_interface_id = aws_instance.test.primary_network_interface_id -} - -resource "aws_ec2_traffic_mirror_target" "gwlb" { - description = "GWLB target" - gateway_load_balancer_endpoint_id = aws_vpc_endpoint.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_traffic_mirror_target import Ec2TrafficMirrorTarget +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TrafficMirrorTarget(self, "eni", + description="ENI target", + network_interface_id=test.primary_network_interface_id + ) + Ec2TrafficMirrorTarget(self, "gwlb", + description="GWLB target", + gateway_load_balancer_endpoint_id=example.id + ) + Ec2TrafficMirrorTarget(self, "nlb", + description="NLB target", + network_load_balancer_arn=lb.arn + ) ``` ## Argument Reference @@ -61,4 +72,4 @@ Traffic mirror targets can be imported using the `id`, e.g., $ terraform import aws_ec2_traffic_mirror_target.target tmt-0c13a005422b86606 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway.html.markdown index 54cff4fa604..318b71200fd 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway --- + + # Resource: aws_ec2_transit_gateway Manages an EC2 Transit Gateway. @@ -13,15 +15,18 @@ Manages an EC2 Transit Gateway. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.ec2_transit_gateway import Ec2TransitGateway +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws.ec2_transit_gateway.Ec2TransitGateway(self, "example", + Ec2TransitGateway(self, "example", description="example" ) ``` @@ -71,4 +76,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway.example tgw-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_connect.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_connect.html.markdown index b879075850f..21a7481e2ed 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_connect.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_connect.html.markdown @@ -6,23 +6,36 @@ description: |- Manages an EC2 Transit Gateway Connect --- + + # Resource: aws_ec2_transit_gateway_connect Manages an EC2 Transit Gateway Connect. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_vpc_attachment" "example" { - subnet_ids = [aws_subnet.example.id] - transit_gateway_id = aws_ec2_transit_gateway.example.id - vpc_id = aws_vpc.example.id -} - -resource "aws_ec2_transit_gateway_connect" "attachment" { - transport_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_id = aws_ec2_transit_gateway.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_connect import Ec2TransitGatewayConnect +from imports.aws.ec2_transit_gateway_vpc_attachment import Ec2TransitGatewayVpcAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Ec2TransitGatewayVpcAttachment(self, "example", + subnet_ids=[Token.as_string(aws_subnet_example.id)], + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id), + vpc_id=Token.as_string(aws_vpc_example.id) + ) + Ec2TransitGatewayConnect(self, "attachment", + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id), + transport_attachment_id=example.id + ) ``` ## Argument Reference @@ -59,4 +72,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_connect.example tgw-attach-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_connect_peer.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_connect_peer.html.markdown index 5ce8eae9788..2076d81bee9 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_connect_peer.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_connect_peer.html.markdown @@ -6,23 +6,39 @@ description: |- Manages an EC2 Transit Gateway Connect Peer --- + + # Resource: aws_ec2_transit_gateway_connect_peer Manages an EC2 Transit Gateway Connect Peer. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_connect" "example" { - transport_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_id = aws_ec2_transit_gateway.example.id -} - -resource "aws_ec2_transit_gateway_connect_peer" "example" { - peer_address = "10.1.2.3" - inside_cidr_blocks = ["169.254.100.0/29"] - transit_gateway_attachment_id = aws_ec2_transit_gateway_connect.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_connect import Ec2TransitGatewayConnect +from imports.aws.ec2_transit_gateway_connect_peer import Ec2TransitGatewayConnectPeer +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Ec2TransitGatewayConnect(self, "example", + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id), + transport_attachment_id=Token.as_string(aws_ec2_transit_gateway_vpc_attachment_example.id) + ) + aws_ec2_transit_gateway_connect_peer_example = + Ec2TransitGatewayConnectPeer(self, "example_1", + inside_cidr_blocks=["169.254.100.0/29"], + peer_address="10.1.2.3", + transit_gateway_attachment_id=example.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_ec2_transit_gateway_connect_peer_example.override_logical_id("example") ``` ## Argument Reference @@ -42,6 +58,8 @@ In addition to all arguments above, the following attributes are exported: * `id` - EC2 Transit Gateway Connect Peer identifier * `arn` - EC2 Transit Gateway Connect Peer ARN +* `bgp_peer_address` - The IP address assigned to customer device, which is used as BGP IP address. +* `bgp_transit_gateway_addresses` - The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses. * `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). ## Timeouts @@ -59,4 +77,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_connect_peer.example tgw-connect-peer-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_domain.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_domain.html.markdown index 93bb146aed9..ddc7a5bcfe8 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_domain.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_domain.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Multicast Domain --- + + # Resource: aws_ec2_transit_gateway_multicast_domain Manages an EC2 Transit Gateway Multicast Domain. @@ -13,32 +15,44 @@ Manages an EC2 Transit Gateway Multicast Domain. ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import property_access, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_ami import DataAwsAmi +from imports.aws.data_aws_availability_zones import DataAwsAvailabilityZones +from imports.aws.ec2_transit_gateway import Ec2TransitGateway +from imports.aws.ec2_transit_gateway_multicast_domain import Ec2TransitGatewayMulticastDomain +from imports.aws.ec2_transit_gateway_multicast_domain_association import Ec2TransitGatewayMulticastDomainAssociation +from imports.aws.ec2_transit_gateway_multicast_group_member import Ec2TransitGatewayMulticastGroupMember +from imports.aws.ec2_transit_gateway_multicast_group_source import Ec2TransitGatewayMulticastGroupSource +from imports.aws.ec2_transit_gateway_vpc_attachment import Ec2TransitGatewayVpcAttachment +from imports.aws.instance import Instance +from imports.aws.subnet import Subnet +from imports.aws.vpc import Vpc +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws_ec2_transit_gateway_tgw = aws.ec2_transit_gateway.Ec2TransitGateway(self, "tgw", + tgw = Ec2TransitGateway(self, "tgw", multicast_support="enable" ) - aws_ec2_transit_gateway_multicast_domain_domain = - aws.ec2_transit_gateway_multicast_domain.Ec2TransitGatewayMulticastDomain(self, "domain", + domain = Ec2TransitGatewayMulticastDomain(self, "domain", static_sources_support="enable", tags={ "Name": "Transit_Gateway_Multicast_Domain_Example" }, - transit_gateway_id=cdktf.Token.as_string(aws_ec2_transit_gateway_tgw.id) + transit_gateway_id=tgw.id ) - aws_vpc_vpc1 = aws.vpc.Vpc(self, "vpc1", + vpc1 = Vpc(self, "vpc1", cidr_block="10.0.0.0/16" ) - aws_vpc_vpc2 = aws.vpc.Vpc(self, "vpc2", + vpc2 = Vpc(self, "vpc2", cidr_block="10.1.0.0/16" ) - data_aws_ami_amazon_linux = aws.data_aws_ami.DataAwsAmi(self, "amazon_linux", + amazon_linux = DataAwsAmi(self, "amazon_linux", filter=[DataAwsAmiFilter( name="name", values=["amzn-ami-hvm-*-x86_64-gp2"] @@ -50,89 +64,78 @@ class MyConvertedCode(cdktf.TerraformStack): most_recent=True, owners=["amazon"] ) - data_aws_availability_zones_available = - aws.data_aws_availability_zones.DataAwsAvailabilityZones(self, "available", + available = DataAwsAvailabilityZones(self, "available", state="available" ) - aws_subnet_subnet1 = aws.subnet.Subnet(self, "subnet1", - availability_zone=cdktf.Token.as_string( - cdktf.property_access(data_aws_availability_zones_available.names, ["0"])), + subnet1 = Subnet(self, "subnet1", + availability_zone=Token.as_string(property_access(available.names, ["0"])), cidr_block="10.0.1.0/24", - vpc_id=cdktf.Token.as_string(aws_vpc_vpc1.id) + vpc_id=vpc1.id ) - aws_subnet_subnet2 = aws.subnet.Subnet(self, "subnet2", - availability_zone=cdktf.Token.as_string( - cdktf.property_access(data_aws_availability_zones_available.names, ["1"])), + subnet2 = Subnet(self, "subnet2", + availability_zone=Token.as_string(property_access(available.names, ["1"])), cidr_block="10.0.2.0/24", - vpc_id=cdktf.Token.as_string(aws_vpc_vpc1.id) + vpc_id=vpc1.id ) - aws_subnet_subnet3 = aws.subnet.Subnet(self, "subnet3", - availability_zone=cdktf.Token.as_string( - cdktf.property_access(data_aws_availability_zones_available.names, ["0"])), + subnet3 = Subnet(self, "subnet3", + availability_zone=Token.as_string(property_access(available.names, ["0"])), cidr_block="10.1.1.0/24", - vpc_id=cdktf.Token.as_string(aws_vpc_vpc2.id) + vpc_id=vpc2.id ) - aws_ec2_transit_gateway_vpc_attachment_attachment1 = - aws.ec2_transit_gateway_vpc_attachment.Ec2TransitGatewayVpcAttachment(self, "attachment1", - subnet_ids=[ - cdktf.Token.as_string(aws_subnet_subnet1.id), - cdktf.Token.as_string(aws_subnet_subnet2.id) - ], - transit_gateway_id=cdktf.Token.as_string(aws_ec2_transit_gateway_tgw.id), - vpc_id=cdktf.Token.as_string(aws_vpc_vpc1.id) + attachment1 = Ec2TransitGatewayVpcAttachment(self, "attachment1", + subnet_ids=[subnet1.id, subnet2.id], + transit_gateway_id=tgw.id, + vpc_id=vpc1.id ) - aws_ec2_transit_gateway_vpc_attachment_attachment2 = - aws.ec2_transit_gateway_vpc_attachment.Ec2TransitGatewayVpcAttachment(self, "attachment2", - subnet_ids=[cdktf.Token.as_string(aws_subnet_subnet3.id)], - transit_gateway_id=cdktf.Token.as_string(aws_ec2_transit_gateway_tgw.id), - vpc_id=cdktf.Token.as_string(aws_vpc_vpc2.id) + attachment2 = Ec2TransitGatewayVpcAttachment(self, "attachment2", + subnet_ids=[subnet3.id], + transit_gateway_id=tgw.id, + vpc_id=vpc2.id ) - aws_instance_instance1 = aws.instance.Instance(self, "instance1", - ami=cdktf.Token.as_string(data_aws_ami_amazon_linux.id), + instance1 = Instance(self, "instance1", + ami=Token.as_string(amazon_linux.id), instance_type="t2.micro", - subnet_id=cdktf.Token.as_string(aws_subnet_subnet1.id) + subnet_id=subnet1.id ) - aws_instance_instance2 = aws.instance.Instance(self, "instance2", - ami=cdktf.Token.as_string(data_aws_ami_amazon_linux.id), + instance2 = Instance(self, "instance2", + ami=Token.as_string(amazon_linux.id), instance_type="t2.micro", - subnet_id=cdktf.Token.as_string(aws_subnet_subnet2.id) + subnet_id=subnet2.id ) - aws_instance_instance3 = aws.instance.Instance(self, "instance3", - ami=cdktf.Token.as_string(data_aws_ami_amazon_linux.id), + instance3 = Instance(self, "instance3", + ami=Token.as_string(amazon_linux.id), instance_type="t2.micro", - subnet_id=cdktf.Token.as_string(aws_subnet_subnet3.id) - ) - aws_ec2_transit_gateway_multicast_domain_association_association1 = - aws.ec2_transit_gateway_multicast_domain_association.Ec2TransitGatewayMulticastDomainAssociation(self, "association1", - subnet_id=cdktf.Token.as_string(aws_subnet_subnet1.id), - transit_gateway_attachment_id=cdktf.Token.as_string(aws_ec2_transit_gateway_vpc_attachment_attachment1.id), - transit_gateway_multicast_domain_id=cdktf.Token.as_string(aws_ec2_transit_gateway_multicast_domain_domain.id) - ) - aws.ec2_transit_gateway_multicast_domain_association.Ec2TransitGatewayMulticastDomainAssociation(self, "association2", - subnet_id=cdktf.Token.as_string(aws_subnet_subnet2.id), - transit_gateway_attachment_id=cdktf.Token.as_string(aws_ec2_transit_gateway_vpc_attachment_attachment2.id), - transit_gateway_multicast_domain_id=cdktf.Token.as_string(aws_ec2_transit_gateway_multicast_domain_domain.id) - ) - aws_ec2_transit_gateway_multicast_domain_association_association3 = - aws.ec2_transit_gateway_multicast_domain_association.Ec2TransitGatewayMulticastDomainAssociation(self, "association3", - subnet_id=cdktf.Token.as_string(aws_subnet_subnet3.id), - transit_gateway_attachment_id=cdktf.Token.as_string(aws_ec2_transit_gateway_vpc_attachment_attachment2.id), - transit_gateway_multicast_domain_id=cdktf.Token.as_string(aws_ec2_transit_gateway_multicast_domain_domain.id) - ) - aws.ec2_transit_gateway_multicast_group_member.Ec2TransitGatewayMulticastGroupMember(self, "member1", + subnet_id=subnet3.id + ) + association1 = Ec2TransitGatewayMulticastDomainAssociation(self, "association1", + subnet_id=subnet1.id, + transit_gateway_attachment_id=attachment1.id, + transit_gateway_multicast_domain_id=domain.id + ) + Ec2TransitGatewayMulticastDomainAssociation(self, "association2", + subnet_id=subnet2.id, + transit_gateway_attachment_id=attachment2.id, + transit_gateway_multicast_domain_id=domain.id + ) + association3 = Ec2TransitGatewayMulticastDomainAssociation(self, "association3", + subnet_id=subnet3.id, + transit_gateway_attachment_id=attachment2.id, + transit_gateway_multicast_domain_id=domain.id + ) + Ec2TransitGatewayMulticastGroupMember(self, "member1", group_ip_address="224.0.0.1", - network_interface_id=cdktf.Token.as_string(aws_instance_instance1.primary_network_interface_id), - transit_gateway_multicast_domain_id=cdktf.Token.as_string(aws_ec2_transit_gateway_multicast_domain_association_association1.transit_gateway_multicast_domain_id) + network_interface_id=instance1.primary_network_interface_id, + transit_gateway_multicast_domain_id=association1.transit_gateway_multicast_domain_id ) - aws.ec2_transit_gateway_multicast_group_member.Ec2TransitGatewayMulticastGroupMember(self, "member2", + Ec2TransitGatewayMulticastGroupMember(self, "member2", group_ip_address="224.0.0.1", - network_interface_id=cdktf.Token.as_string(aws_instance_instance2.primary_network_interface_id), - transit_gateway_multicast_domain_id=cdktf.Token.as_string(aws_ec2_transit_gateway_multicast_domain_association_association1.transit_gateway_multicast_domain_id) + network_interface_id=instance2.primary_network_interface_id, + transit_gateway_multicast_domain_id=association1.transit_gateway_multicast_domain_id ) - aws.ec2_transit_gateway_multicast_group_source.Ec2TransitGatewayMulticastGroupSource(self, "source", + Ec2TransitGatewayMulticastGroupSource(self, "source", group_ip_address="224.0.0.1", - network_interface_id=cdktf.Token.as_string(aws_instance_instance3.primary_network_interface_id), - transit_gateway_multicast_domain_id=cdktf.Token.as_string(aws_ec2_transit_gateway_multicast_domain_association_association3.transit_gateway_multicast_domain_id) + network_interface_id=instance3.primary_network_interface_id, + transit_gateway_multicast_domain_id=association3.transit_gateway_multicast_domain_id ) ``` @@ -170,4 +173,4 @@ In addition to all arguments above, the following attributes are exported: terraform import aws_ec2_transit_gateway_multicast_domain.example tgw-mcast-domain-12345 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_domain_association.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_domain_association.html.markdown index 6a56a74beee..8daca70bb3f 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_domain_association.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_domain_association.html.markdown @@ -6,32 +6,54 @@ description: |- Manages an EC2 Transit Gateway Multicast Domain Association --- + + # Resource: aws_ec2_transit_gateway_multicast_domain_association Associates the specified subnet and transit gateway attachment with the specified transit gateway multicast domain. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway" "example" { - multicast_support = "enable" -} - -resource "aws_ec2_transit_gateway_vpc_attachment" "example" { - subnet_ids = [aws_subnet.example.id] - transit_gateway_id = aws_ec2_transit_gateway.example.id - vpc_id = aws_vpc.example.id -} - -resource "aws_ec2_transit_gateway_multicast_domain" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id -} - -resource "aws_ec2_transit_gateway_multicast_domain_association" "example" { - subnet_id = aws_subnet.example.id - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_multicast_domain_id = aws_ec2_transit_gateway_multicast_domain.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway import Ec2TransitGateway +from imports.aws.ec2_transit_gateway_multicast_domain import Ec2TransitGatewayMulticastDomain +from imports.aws.ec2_transit_gateway_multicast_domain_association import Ec2TransitGatewayMulticastDomainAssociation +from imports.aws.ec2_transit_gateway_vpc_attachment import Ec2TransitGatewayVpcAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Ec2TransitGateway(self, "example", + multicast_support="enable" + ) + aws_ec2_transit_gateway_multicast_domain_example = + Ec2TransitGatewayMulticastDomain(self, "example_1", + transit_gateway_id=example.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_ec2_transit_gateway_multicast_domain_example.override_logical_id("example") + aws_ec2_transit_gateway_vpc_attachment_example = + Ec2TransitGatewayVpcAttachment(self, "example_2", + subnet_ids=[Token.as_string(aws_subnet_example.id)], + transit_gateway_id=example.id, + vpc_id=Token.as_string(aws_vpc_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_ec2_transit_gateway_vpc_attachment_example.override_logical_id("example") + aws_ec2_transit_gateway_multicast_domain_association_example = + Ec2TransitGatewayMulticastDomainAssociation(self, "example_3", + subnet_id=Token.as_string(aws_subnet_example.id), + transit_gateway_attachment_id=Token.as_string(aws_ec2_transit_gateway_vpc_attachment_example.id), + transit_gateway_multicast_domain_id=Token.as_string(aws_ec2_transit_gateway_multicast_domain_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_ec2_transit_gateway_multicast_domain_association_example.override_logical_id("example") ``` ## Argument Reference @@ -55,4 +77,4 @@ In addition to all arguments above, the following attributes are exported: - `create` - (Default `10m`) - `delete` - (Default `10m`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_group_member.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_group_member.html.markdown index f2dd0248c9b..891442db7dd 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_group_member.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_group_member.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Multicast Group Member --- + + # Resource: aws_ec2_transit_gateway_multicast_group_member Registers members (network interfaces) with the transit gateway multicast group. @@ -13,12 +15,23 @@ A member is a network interface associated with a supported EC2 instance that re ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_multicast_group_member" "example" { - group_ip_address = "224.0.0.1" - network_interface_id = aws_network_interface.example.id - transit_gateway_multicast_domain_id = aws_ec2_transit_gateway_multicast_domain.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_multicast_group_member import Ec2TransitGatewayMulticastGroupMember +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayMulticastGroupMember(self, "example", + group_ip_address="224.0.0.1", + network_interface_id=Token.as_string(aws_network_interface_example.id), + transit_gateway_multicast_domain_id=Token.as_string(aws_ec2_transit_gateway_multicast_domain_example.id) + ) ``` ## Argument Reference @@ -35,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - EC2 Transit Gateway Multicast Group Member identifier. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_group_source.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_group_source.html.markdown index 41d11afb87f..02af800e0c2 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_group_source.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_multicast_group_source.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Multicast Group Source --- + + # Resource: aws_ec2_transit_gateway_multicast_group_source Registers sources (network interfaces) with the transit gateway multicast group. @@ -13,12 +15,23 @@ A multicast source is a network interface attached to a supported instance that ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_multicast_group_source" "example" { - group_ip_address = "224.0.0.1" - network_interface_id = aws_network_interface.example.id - transit_gateway_multicast_domain_id = aws_ec2_transit_gateway_multicast_domain.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_multicast_group_source import Ec2TransitGatewayMulticastGroupSource +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayMulticastGroupSource(self, "example", + group_ip_address="224.0.0.1", + network_interface_id=Token.as_string(aws_network_interface_example.id), + transit_gateway_multicast_domain_id=Token.as_string(aws_ec2_transit_gateway_multicast_domain_example.id) + ) ``` ## Argument Reference @@ -35,4 +48,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - EC2 Transit Gateway Multicast Group Member identifier. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_peering_attachment.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_peering_attachment.html.markdown index 1bbcb3b3a96..ffd538c9b23 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_peering_attachment.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_peering_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Peering Attachment --- + + # Resource: aws_ec2_transit_gateway_peering_attachment Manages an EC2 Transit Gateway Peering Attachment. @@ -14,49 +16,53 @@ For examples of custom route table association and propagation, see the [EC2 Tra ## Example Usage ```python -import constructs as constructs -import cdktf as cdktf -# Provider bindings are generated by running cdktf get. +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. # See https://cdk.tf/provider-generation for more details. -import ...gen.providers.aws as aws -class MyConvertedCode(cdktf.TerraformStack): +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.ec2_transit_gateway import Ec2TransitGateway +from imports.aws.ec2_transit_gateway_peering_attachment import Ec2TransitGatewayPeeringAttachment +from imports.aws.provider import AwsProvider +class MyConvertedCode(TerraformStack): def __init__(self, scope, name): super().__init__(scope, name) - aws_local = aws.provider.AwsProvider(self, "aws", + local = AwsProvider(self, "aws", alias="local", region="us-east-1" ) - aws_peer = aws.provider.AwsProvider(self, "aws_1", + peer = AwsProvider(self, "aws_1", alias="peer", region="us-west-2" ) - aws_ec2_transit_gateway_local = - aws.ec2_transit_gateway.Ec2TransitGateway(self, "local", - provider=aws_local, + aws_ec2_transit_gateway_local = Ec2TransitGateway(self, "local", + provider=local, tags={ "Name": "Local TGW" } ) - aws_ec2_transit_gateway_peer = - aws.ec2_transit_gateway.Ec2TransitGateway(self, "peer", - provider=aws_peer, + aws_ec2_transit_gateway_peer = Ec2TransitGateway(self, "peer", + provider=peer, tags={ "Name": "Peer TGW" } ) - data_aws_region_peer = aws.data_aws_region.DataAwsRegion(self, "peer_4", - provider=aws_peer + data_aws_region_peer = DataAwsRegion(self, "peer_4", + provider=peer ) # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. data_aws_region_peer.override_logical_id("peer") - aws.ec2_transit_gateway_peering_attachment.Ec2TransitGatewayPeeringAttachment(self, "example", - peer_account_id=cdktf.Token.as_string(aws_ec2_transit_gateway_peer.owner_id), - peer_region=cdktf.Token.as_string(data_aws_region_peer.name), - peer_transit_gateway_id=cdktf.Token.as_string(aws_ec2_transit_gateway_peer.id), + Ec2TransitGatewayPeeringAttachment(self, "example", + peer_account_id=Token.as_string(aws_ec2_transit_gateway_peer.owner_id), + peer_region=Token.as_string(data_aws_region_peer.name), + peer_transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_peer.id), tags={ "Name": "TGW Peering Requestor" }, - transit_gateway_id=cdktf.Token.as_string(aws_ec2_transit_gateway_local.id) + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_local.id) ) ``` @@ -89,4 +95,4 @@ terraform import aws_ec2_transit_gateway_peering_attachment.example tgw-attach-1 [1]: /docs/providers/aws/index.html - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_peering_attachment_accepter.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_peering_attachment_accepter.html.markdown index f09ba0dea8f..41361a94179 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_peering_attachment_accepter.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_peering_attachment_accepter.html.markdown @@ -6,20 +6,32 @@ description: |- Manages the accepter's side of an EC2 Transit Gateway peering Attachment --- + + # Resource: aws_ec2_transit_gateway_peering_attachment_accepter Manages the accepter's side of an EC2 Transit Gateway Peering Attachment. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_peering_attachment_accepter" "example" { - transit_gateway_attachment_id = aws_ec2_transit_gateway_peering_attachment.example.id - - tags = { - Name = "Example cross-account attachment" - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_peering_attachment_accepter import Ec2TransitGatewayPeeringAttachmentAccepter +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayPeeringAttachmentAccepter(self, "example", + tags={ + "Name": "Example cross-account attachment" + }, + transit_gateway_attachment_id=Token.as_string(aws_ec2_transit_gateway_peering_attachment_example.id) + ) ``` A full example of how to create a Transit Gateway in one AWS account, share it with a second AWS account, and attach a to a Transit Gateway in the second account via the `aws_ec2_transit_gateway_peering_attachment` resource can be found in [the `./examples/transit-gateway-cross-account-peering-attachment` directory within the Github Repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/transit-gateway-cross-account-peering-attachment). @@ -49,4 +61,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_peering_attachment_accepter.example tgw-attach-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_policy_table.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_policy_table.html.markdown index dc9ab805bca..5da680efa88 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_policy_table.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_policy_table.html.markdown @@ -6,20 +6,32 @@ description: |- Manages an EC2 Transit Gateway Policy Table --- + + # Resource: aws_ec2_transit_gateway_policy_table Manages an EC2 Transit Gateway Policy Table. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_policy_table" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id - - tags = { - Name = "Example Policy Table" - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_policy_table import Ec2TransitGatewayPolicyTable +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayPolicyTable(self, "example", + tags={ + "Name": "Example Policy Table" + }, + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id) + ) ``` ## Argument Reference @@ -46,4 +58,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_policy_table.example tgw-rtb-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_policy_table_association.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_policy_table_association.html.markdown index ecf06015b0d..5f7989e4313 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_policy_table_association.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_policy_table_association.html.markdown @@ -6,17 +6,30 @@ description: |- Manages an EC2 Transit Gateway Policy Table association --- + + # Resource: aws_ec2_transit_gateway_policy_table_association Manages an EC2 Transit Gateway Policy Table association. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_policy_table_association" "example" { - transit_gateway_attachment_id = aws_networkmanager_transit_gateway_peering.example.transit_gateway_peering_attachment_id - transit_gateway_policy_table_id = aws_ec2_transit_gateway_policy_table.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_policy_table_association import Ec2TransitGatewayPolicyTableAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayPolicyTableAssociation(self, "example", + transit_gateway_attachment_id=Token.as_string(aws_networkmanager_transit_gateway_peering_example.transit_gateway_peering_attachment_id), + transit_gateway_policy_table_id=Token.as_string(aws_ec2_transit_gateway_policy_table_example.id) + ) ``` ## Argument Reference @@ -42,4 +55,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_policy_table_association.example tgw-rtb-12345678_tgw-attach-87654321 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_prefix_list_reference.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_prefix_list_reference.html.markdown index 6dcdfb21f4f..4ab84308341 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_prefix_list_reference.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_prefix_list_reference.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Prefix List Reference --- + + # Resource: aws_ec2_transit_gateway_prefix_list_reference Manages an EC2 Transit Gateway Prefix List Reference. @@ -14,22 +16,44 @@ Manages an EC2 Transit Gateway Prefix List Reference. ### Attachment Routing -```terraform -resource "aws_ec2_transit_gateway_prefix_list_reference" "example" { - prefix_list_id = aws_ec2_managed_prefix_list.example.id - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway.example.association_default_route_table_id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_prefix_list_reference import Ec2TransitGatewayPrefixListReference +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayPrefixListReference(self, "example", + prefix_list_id=Token.as_string(aws_ec2_managed_prefix_list_example.id), + transit_gateway_attachment_id=Token.as_string(aws_ec2_transit_gateway_vpc_attachment_example.id), + transit_gateway_route_table_id=Token.as_string(aws_ec2_transit_gateway_example.association_default_route_table_id) + ) ``` ### Blackhole Routing -```terraform -resource "aws_ec2_transit_gateway_prefix_list_reference" "example" { - blackhole = true - prefix_list_id = aws_ec2_managed_prefix_list.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway.example.association_default_route_table_id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_prefix_list_reference import Ec2TransitGatewayPrefixListReference +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayPrefixListReference(self, "example", + blackhole=True, + prefix_list_id=Token.as_string(aws_ec2_managed_prefix_list_example.id), + transit_gateway_route_table_id=Token.as_string(aws_ec2_transit_gateway_example.association_default_route_table_id) + ) ``` ## Argument Reference @@ -58,4 +82,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_prefix_list_reference.example tgw-rtb-12345678_pl-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_route.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_route.html.markdown index 383121e4257..21a8d377390 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_route.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_route.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Route --- + + # Resource: aws_ec2_transit_gateway_route Manages an EC2 Transit Gateway Route. @@ -14,22 +16,44 @@ Manages an EC2 Transit Gateway Route. ### Standard usage -```terraform -resource "aws_ec2_transit_gateway_route" "example" { - destination_cidr_block = "0.0.0.0/0" - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway.example.association_default_route_table_id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_route import Ec2TransitGatewayRoute +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayRoute(self, "example", + destination_cidr_block="0.0.0.0/0", + transit_gateway_attachment_id=Token.as_string(aws_ec2_transit_gateway_vpc_attachment_example.id), + transit_gateway_route_table_id=Token.as_string(aws_ec2_transit_gateway_example.association_default_route_table_id) + ) ``` ### Blackhole route -```terraform -resource "aws_ec2_transit_gateway_route" "example" { - destination_cidr_block = "0.0.0.0/0" - blackhole = true - transit_gateway_route_table_id = aws_ec2_transit_gateway.example.association_default_route_table_id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_route import Ec2TransitGatewayRoute +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayRoute(self, "example", + blackhole=True, + destination_cidr_block="0.0.0.0/0", + transit_gateway_route_table_id=Token.as_string(aws_ec2_transit_gateway_example.association_default_route_table_id) + ) ``` ## Argument Reference @@ -55,4 +79,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_route.example tgw-rtb-12345678_0.0.0.0/0 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_route_table.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_route_table.html.markdown index 013d344a1e1..798812fa10e 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_route_table.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_route_table.html.markdown @@ -6,16 +6,29 @@ description: |- Manages an EC2 Transit Gateway Route Table --- + + # Resource: aws_ec2_transit_gateway_route_table Manages an EC2 Transit Gateway Route Table. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_route_table" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_route_table import Ec2TransitGatewayRouteTable +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayRouteTable(self, "example", + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id) + ) ``` ## Argument Reference @@ -43,4 +56,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_route_table.example tgw-rtb-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_route_table_association.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_route_table_association.html.markdown index 44073ddc56f..5142d47eb1b 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_route_table_association.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_route_table_association.html.markdown @@ -6,17 +6,30 @@ description: |- Manages an EC2 Transit Gateway Route Table association --- + + # Resource: aws_ec2_transit_gateway_route_table_association Manages an EC2 Transit Gateway Route Table association. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_route_table_association" "example" { - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_route_table_association import Ec2TransitGatewayRouteTableAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayRouteTableAssociation(self, "example", + transit_gateway_attachment_id=Token.as_string(aws_ec2_transit_gateway_vpc_attachment_example.id), + transit_gateway_route_table_id=Token.as_string(aws_ec2_transit_gateway_route_table_example.id) + ) ``` ## Argument Reference @@ -25,6 +38,7 @@ The following arguments are supported: * `transit_gateway_attachment_id` - (Required) Identifier of EC2 Transit Gateway Attachment. * `transit_gateway_route_table_id` - (Required) Identifier of EC2 Transit Gateway Route Table. +* `replace_existing_association` - (Optional) Boolean whether the Gateway Attachment should remove any current Route Table association before associating with the specified Route Table. Default value: `false`. This argument is intended for use with EC2 Transit Gateways shared into the current account, otherwise the `transit_gateway_default_route_table_association` argument of the `aws_ec2_transit_gateway_vpc_attachment` resource should be used. ## Attributes Reference @@ -42,4 +56,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_route_table_association.example tgw-rtb-12345678_tgw-attach-87654321 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_route_table_propagation.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_route_table_propagation.html.markdown index 302b9252679..fc13a52b0c8 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_route_table_propagation.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_route_table_propagation.html.markdown @@ -6,17 +6,30 @@ description: |- Manages an EC2 Transit Gateway Route Table propagation --- + + # Resource: aws_ec2_transit_gateway_route_table_propagation Manages an EC2 Transit Gateway Route Table propagation. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_route_table_propagation" "example" { - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_route_table_propagation import Ec2TransitGatewayRouteTablePropagation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayRouteTablePropagation(self, "example", + transit_gateway_attachment_id=Token.as_string(aws_ec2_transit_gateway_vpc_attachment_example.id), + transit_gateway_route_table_id=Token.as_string(aws_ec2_transit_gateway_route_table_example.id) + ) ``` ## Argument Reference @@ -42,4 +55,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_route_table_propagation.example tgw-rtb-12345678_tgw-attach-87654321 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_vpc_attachment.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_vpc_attachment.html.markdown index 7c61855a797..a539cd80df1 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_vpc_attachment.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_vpc_attachment.html.markdown @@ -6,18 +6,31 @@ description: |- Manages an EC2 Transit Gateway VPC Attachment --- + + # Resource: aws_ec2_transit_gateway_vpc_attachment Manages an EC2 Transit Gateway VPC Attachment. For examples of custom route table association and propagation, see the EC2 Transit Gateway Networking Examples Guide. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_vpc_attachment" "example" { - subnet_ids = [aws_subnet.example.id] - transit_gateway_id = aws_ec2_transit_gateway.example.id - vpc_id = aws_vpc.example.id -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_vpc_attachment import Ec2TransitGatewayVpcAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayVpcAttachment(self, "example", + subnet_ids=[Token.as_string(aws_subnet_example.id)], + transit_gateway_id=Token.as_string(aws_ec2_transit_gateway_example.id), + vpc_id=Token.as_string(aws_vpc_example.id) + ) ``` A full example of how to create a Transit Gateway in one AWS account, share it with a second AWS account, and attach a VPC in the second account to the Transit Gateway via the `aws_ec2_transit_gateway_vpc_attachment` and `aws_ec2_transit_gateway_vpc_attachment_accepter` resources can be found in [the `./examples/transit-gateway-cross-account-vpc-attachment` directory within the Github Repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/transit-gateway-cross-account-vpc-attachment). @@ -52,4 +65,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_vpc_attachment.example tgw-attach-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown b/website/docs/cdktf/python/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown index a1096e1d9a3..1bc8c29d40c 100644 --- a/website/docs/cdktf/python/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown +++ b/website/docs/cdktf/python/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown @@ -6,6 +6,8 @@ description: |- Manages the accepter's side of an EC2 Transit Gateway VPC Attachment --- + + # Resource: aws_ec2_transit_gateway_vpc_attachment_accepter Manages the accepter's side of an EC2 Transit Gateway VPC Attachment. @@ -18,14 +20,24 @@ connection into management. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "example" { - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - - tags = { - Name = "Example cross-account attachment" - } -} +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.ec2_transit_gateway_vpc_attachment_accepter import Ec2TransitGatewayVpcAttachmentAccepter +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Ec2TransitGatewayVpcAttachmentAccepter(self, "example", + tags={ + "Name": "Example cross-account attachment" + }, + transit_gateway_attachment_id=Token.as_string(aws_ec2_transit_gateway_vpc_attachment_example.id) + ) ``` A full example of how to create a Transit Gateway in one AWS account, share it with a second AWS account, and attach a VPC in the second account to the Transit Gateway via the `aws_ec2_transit_gateway_vpc_attachment` and `aws_ec2_transit_gateway_vpc_attachment_accepter` resources can be found in [the `./examples/transit-gateway-cross-account-vpc-attachment` directory within the Github Repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/transit-gateway-cross-account-vpc-attachment). @@ -61,4 +73,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_vpc_attachment_accepter.example tgw-attach-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/eks_addon.html.markdown b/website/docs/cdktf/python/r/eks_addon.html.markdown new file mode 100644 index 00000000000..cd3636c7ad9 --- /dev/null +++ b/website/docs/cdktf/python/r/eks_addon.html.markdown @@ -0,0 +1,247 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_addon" +description: |- + Manages an EKS add-on +--- + + + +# Resource: aws_eks_addon + +Manages an EKS add-on. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_addon import EksAddon +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + EksAddon(self, "example", + addon_name="vpc-cni", + cluster_name=Token.as_string(aws_eks_cluster_example.name) + ) +``` + +## Example Update add-on usage with resolve_conflicts_on_update and PRESERVE + +`resolve_conflicts_on_update` with `PRESERVE` can be used to retain the config changes applied to the add-on with kubectl while upgrading to a newer version of the add-on. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_addon import EksAddon +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + EksAddon(self, "example", + addon_name="coredns", + addon_version="v1.10.1-eksbuild.1", + cluster_name=Token.as_string(aws_eks_cluster_example.name), + resolve_conflicts_on_update="PRESERVE" + ) +``` + +## Example add-on usage with custom configuration_values + +Custom add-on configuration can be passed using `configuration_values` as a single JSON string while creating or updating the add-on. + +~> **Note:** `configuration_values` is a single JSON string should match the valid JSON schema for each add-on with specific version. + +To find the correct JSON schema for each add-on can be extracted using [describe-addon-configuration](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-configuration.html) call. +This below is an example for extracting the `configuration_values` schema for `coredns`. + +```bash + aws eks describe-addon-configuration \ + --addon-name coredns \ + --addon-version v1.10.1-eksbuild.1 +``` + +Example to create a `coredns` managed addon with custom `configuration_values`. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_addon import EksAddon +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + EksAddon(self, "example", + addon_name="coredns", + addon_version="v1.10.1-eksbuild.1", + cluster_name="mycluster", + configuration_values=Token.as_string( + Fn.jsonencode({ + "replica_count": 4, + "resources": { + "limits": { + "cpu": "100m", + "memory": "150Mi" + }, + "requests": { + "cpu": "100m", + "memory": "150Mi" + } + } + })), + resolve_conflicts_on_create="OVERWRITE" + ) +``` + +### Example IAM Role for EKS Addon "vpc-cni" with AWS managed policy + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import property_access, Token, Fn, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.eks_cluster import EksCluster +from imports.aws.iam_openid_connect_provider import IamOpenidConnectProvider +from imports.aws.iam_role import IamRole +from imports.aws.iam_role_policy_attachment import IamRolePolicyAttachment +from imports.tls.data_tls_certificate import DataTlsCertificate +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, name, roleArn, vpcConfig): + super().__init__(scope, name) + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: tls. + # For a more precise conversion please use the --provider flag in convert. + example = EksCluster(self, "example", + name=name, + role_arn=role_arn, + vpc_config=vpc_config + ) + data_tls_certificate_example = DataTlsCertificate(self, "example_1", + url=property_access(example.identity, ["0", "oidc", "0", "issuer"]) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_tls_certificate_example.override_logical_id("example") + aws_iam_openid_connect_provider_example = IamOpenidConnectProvider(self, "example_2", + client_id_list=["sts.amazonaws.com"], + thumbprint_list=[ + Token.as_string( + property_access(data_tls_certificate_example.certificates, ["0", "sha1_fingerprint" + ])) + ], + url=Token.as_string( + property_access(example.identity, ["0", "oidc", "0", "issuer"])) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_iam_openid_connect_provider_example.override_logical_id("example") + example_assume_role_policy = DataAwsIamPolicyDocument(self, "example_assume_role_policy", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["sts:AssumeRoleWithWebIdentity"], + condition=[DataAwsIamPolicyDocumentStatementCondition( + test="StringEquals", + values=["system:serviceaccount:kube-system:aws-node"], + variable= + Token.as_string( + Fn.replace( + Token.as_string(aws_iam_openid_connect_provider_example.url), "https://", "")) + ":sub" + ) + ], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=[ + Token.as_string(aws_iam_openid_connect_provider_example.arn) + ], + type="Federated" + ) + ] + ) + ] + ) + aws_iam_role_example = IamRole(self, "example_4", + assume_role_policy=Token.as_string(example_assume_role_policy.json), + name="example-vpc-cni-role" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_iam_role_example.override_logical_id("example") + aws_iam_role_policy_attachment_example = IamRolePolicyAttachment(self, "example_5", + policy_arn="arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", + role=Token.as_string(aws_iam_role_example.name) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_iam_role_policy_attachment_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are required: + +* `addon_name` – (Required) Name of the EKS add-on. The name must match one of + the names returned by [describe-addon-versions](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-versions.html). +* `cluster_name` – (Required) Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). + +The following arguments are optional: + +* `addon_version` – (Optional) The version of the EKS add-on. The version must + match one of the versions returned by [describe-addon-versions](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-versions.html). +* `configuration_values` - (Optional) custom configuration values for addons with single JSON string. This JSON string value must match the JSON schema derived from [describe-addon-configuration](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-configuration.html). +* `resolve_conflicts_on_create` - (Optional) How to resolve field value conflicts when migrating a self-managed add-on to an Amazon EKS add-on. Valid values are `NONE` and `OVERWRITE`. For more details see the [CreateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateAddon.html) API Docs. +* `resolve_conflicts_on_update` - (Optional) How to resolve field value conflicts for an Amazon EKS add-on if you've changed a value from the Amazon EKS default value. Valid values are `NONE`, `OVERWRITE`, and `PRESERVE`. For more details see the [UpdateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) API Docs. +* `resolve_conflicts` - (**Deprecated** use the `resolve_conflicts_on_create` and `resolve_conflicts_on_update` attributes instead) Define how to resolve parameter value conflicts when migrating an existing add-on to an Amazon EKS add-on or when applying version updates to the add-on. Valid values are `NONE`, `OVERWRITE` and `PRESERVE`. Note that `PRESERVE` is only valid on addon update, not for initial addon creation. If you need to set this to `PRESERVE`, use the `resolve_conflicts_on_create` and `resolve_conflicts_on_update` attributes instead. For more details check [UpdateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) API Docs. +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `preserve` - (Optional) Indicates if you want to preserve the created resources when deleting the EKS add-on. +* `service_account_role_arn` - (Optional) The Amazon Resource Name (ARN) of an + existing IAM role to bind to the add-on's service account. The role must be + assigned the IAM permissions required by the add-on. If you don't specify + an existing IAM role, then the add-on uses the permissions assigned to the node + IAM role. For more information, see [Amazon EKS node IAM role](https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html) + in the Amazon EKS User Guide. + + ~> **Note:** To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) + provider created for your cluster. For more information, [see Enabling IAM roles + for service accounts on your cluster](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html) + in the Amazon EKS User Guide. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the EKS add-on. +* `id` - EKS Cluster name and EKS Addon name separated by a colon (`:`). +* `status` - Status of the EKS add-on. +* `created_at` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was created. +* `modified_at` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was updated. +* `tags_all` - (Optional) Key-value map of resource tags, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `20m`) +* `update` - (Default `20m`) +* `delete` - (Default `40m`) + +## Import + +EKS add-on can be imported using the `cluster_name` and `addon_name` separated by a colon (`:`), e.g., + +``` +$ terraform import aws_eks_addon.my_eks_addon my_cluster_name:my_addon_name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/eks_cluster.html.markdown b/website/docs/cdktf/python/r/eks_cluster.html.markdown new file mode 100644 index 00000000000..ccf3a87d87c --- /dev/null +++ b/website/docs/cdktf/python/r/eks_cluster.html.markdown @@ -0,0 +1,367 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_cluster" +description: |- + Manages an EKS Cluster +--- + + + +# Resource: aws_eks_cluster + +Manages an EKS Cluster. + +> **Hands-on:** For an example of `aws_eks_cluster` in use, follow the [Provision an EKS Cluster](https://learn.hashicorp.com/tutorials/terraform/eks) tutorial on HashiCorp Learn. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformOutput, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_cluster import EksCluster +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = EksCluster(self, "example", + depends_on=[example_amazon_eks_cluster_policy, example_amazon_eksvpc_resource_controller + ], + name="example", + role_arn=Token.as_string(aws_iam_role_example.arn), + vpc_config=EksClusterVpcConfig( + subnet_ids=[example1.id, example2.id] + ) + ) + TerraformOutput(self, "endpoint", + value=example.endpoint + ) + TerraformOutput(self, "kubeconfig-certificate-authority-data", + value=property_access(example.certificate_authority, ["0", "data"]) + ) +``` + +### Example IAM Role for EKS Cluster + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.iam_role import IamRole +from imports.aws.iam_role_policy_attachment import IamRolePolicyAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + assume_role = DataAwsIamPolicyDocument(self, "assume_role", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["sts:AssumeRole"], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=["eks.amazonaws.com"], + type="Service" + ) + ] + ) + ] + ) + example = IamRole(self, "example", + assume_role_policy=Token.as_string(assume_role.json), + name="eks-cluster-example" + ) + IamRolePolicyAttachment(self, "example-AmazonEKSClusterPolicy", + policy_arn="arn:aws:iam::aws:policy/AmazonEKSClusterPolicy", + role=example.name + ) + IamRolePolicyAttachment(self, "example-AmazonEKSVPCResourceController", + policy_arn="arn:aws:iam::aws:policy/AmazonEKSVPCResourceController", + role=example.name + ) +``` + +### Enabling Control Plane Logging + +[EKS Control Plane Logging](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) can be enabled via the `enabled_cluster_log_types` argument. To manage the CloudWatch Log Group retention period, the [`aws_cloudwatch_log_group` resource](/docs/providers/aws/r/cloudwatch_log_group.html) can be used. + +-> The below configuration uses [`depends_on`](https://www.terraform.io/docs/configuration/meta-arguments/depends_on.html) to prevent ordering issues with EKS automatically creating the log group first and a variable for naming consistency. Other ordering and naming methodologies may be more appropriate for your environment. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import VariableType, TerraformVariable, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.cloudwatch_log_group import CloudwatchLogGroup +from imports.aws.eks_cluster import EksCluster +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, roleArn, vpcConfig): + super().__init__(scope, name) + # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + # You can read more about this at https://cdk.tf/variables + cluster_name = TerraformVariable(self, "cluster_name", + default="example", + type=VariableType.STRING + ) + example = CloudwatchLogGroup(self, "example", + name="/aws/eks/${" + cluster_name.value + "}/cluster", + retention_in_days=7 + ) + aws_eks_cluster_example = EksCluster(self, "example_2", + depends_on=[example], + enabled_cluster_log_types=["api", "audit"], + name=cluster_name.string_value, + role_arn=role_arn, + vpc_config=vpc_config + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_eks_cluster_example.override_logical_id("example") +``` + +### Enabling IAM Roles for Service Accounts + +Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For more information about this feature, see the [EKS User Guide](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html). + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import property_access, Token, Fn, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.eks_cluster import EksCluster +from imports.aws.iam_openid_connect_provider import IamOpenidConnectProvider +from imports.aws.iam_role import IamRole +from imports.tls.data_tls_certificate import DataTlsCertificate +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, name, roleArn, vpcConfig): + super().__init__(scope, name) + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: tls. + # For a more precise conversion please use the --provider flag in convert. + example = EksCluster(self, "example", + name=name, + role_arn=role_arn, + vpc_config=vpc_config + ) + data_tls_certificate_example = DataTlsCertificate(self, "example_1", + url=property_access(example.identity, ["0", "oidc", "0", "issuer"]) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_tls_certificate_example.override_logical_id("example") + aws_iam_openid_connect_provider_example = IamOpenidConnectProvider(self, "example_2", + client_id_list=["sts.amazonaws.com"], + thumbprint_list=Token.as_list( + property_access(data_tls_certificate_example.certificates, ["*", "sha1_fingerprint" + ])), + url=Token.as_string(data_tls_certificate_example.url) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_iam_openid_connect_provider_example.override_logical_id("example") + example_assume_role_policy = DataAwsIamPolicyDocument(self, "example_assume_role_policy", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["sts:AssumeRoleWithWebIdentity"], + condition=[DataAwsIamPolicyDocumentStatementCondition( + test="StringEquals", + values=["system:serviceaccount:kube-system:aws-node"], + variable= + Token.as_string( + Fn.replace( + Token.as_string(aws_iam_openid_connect_provider_example.url), "https://", "")) + ":sub" + ) + ], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=[ + Token.as_string(aws_iam_openid_connect_provider_example.arn) + ], + type="Federated" + ) + ] + ) + ] + ) + aws_iam_role_example = IamRole(self, "example_4", + assume_role_policy=Token.as_string(example_assume_role_policy.json), + name="example" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_iam_role_example.override_logical_id("example") +``` + +### EKS Cluster on AWS Outpost + +[Creating a local Amazon EKS cluster on an AWS Outpost](https://docs.aws.amazon.com/eks/latest/userguide/create-cluster-outpost.html) + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_cluster import EksCluster +from imports.aws.iam_role import IamRole +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, subnetIds): + super().__init__(scope, name) + example = IamRole(self, "example", + assume_role_policy=Token.as_string(example_assume_role_policy.json), + name="example" + ) + aws_eks_cluster_example = EksCluster(self, "example_1", + name="example-cluster", + outpost_config=EksClusterOutpostConfig( + control_plane_instance_type="m5d.large", + outpost_arns=[Token.as_string(data_aws_outposts_outpost_example.arn)] + ), + role_arn=example.arn, + vpc_config=EksClusterVpcConfig( + endpoint_private_access=True, + endpoint_public_access=False, + subnet_ids=subnet_ids + ) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_eks_cluster_example.override_logical_id("example") +``` + +After adding inline IAM Policies (e.g., [`aws_iam_role_policy` resource](/docs/providers/aws/r/iam_role_policy.html)) or attaching IAM Policies (e.g., [`aws_iam_policy` resource](/docs/providers/aws/r/iam_policy.html) and [`aws_iam_role_policy_attachment` resource](/docs/providers/aws/r/iam_role_policy_attachment.html)) with the desired permissions to the IAM Role, annotate the Kubernetes service account (e.g., [`kubernetes_service_account` resource](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account)) and recreate any pods. + +## Argument Reference + +The following arguments are required: + +* `name` – (Required) Name of the cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). +* `role_arn` - (Required) ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. Ensure the resource configuration includes explicit dependencies on the IAM Role permissions by adding [`depends_on`](https://www.terraform.io/docs/configuration/meta-arguments/depends_on.html) if using the [`aws_iam_role_policy` resource](/docs/providers/aws/r/iam_role_policy.html) or [`aws_iam_role_policy_attachment` resource](/docs/providers/aws/r/iam_role_policy_attachment.html), otherwise EKS cannot delete EKS managed EC2 infrastructure such as Security Groups on EKS Cluster deletion. +* `vpc_config` - (Required) Configuration block for the VPC associated with your cluster. Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see [Cluster VPC Considerations](https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) and [Cluster Security Group Considerations](https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) in the Amazon EKS User Guide. Detailed below. Also contains attributes detailed in the Attributes section. + +The following arguments are optional: + +* `enabled_cluster_log_types` - (Optional) List of the desired control plane logging to enable. For more information, see [Amazon EKS Control Plane Logging](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html). +* `encryption_config` - (Optional) Configuration block with encryption configuration for the cluster. Only available on Kubernetes 1.13 and above clusters created after March 6, 2020. Detailed below. +* `kubernetes_network_config` - (Optional) Configuration block with kubernetes network configuration for the cluster. Detailed below. If removed, Terraform will only perform drift detection if a configuration value is provided. +* `outpost_config` - (Optional) Configuration block representing the configuration of your local Amazon EKS cluster on an AWS Outpost. This block isn't available for creating Amazon EKS clusters on the AWS cloud. +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `version` – (Optional) Desired Kubernetes master version. If you do not specify a value, the latest available version at resource creation is used and no upgrades will occur except those automatically triggered by EKS. The value must be configured and increased to upgrade the version when desired. Downgrades are not supported by EKS. + +### encryption_config + +The following arguments are supported in the `encryption_config` configuration block: + +* `provider` - (Required) Configuration block with provider for encryption. Detailed below. +* `resources` - (Required) List of strings with resources to be encrypted. Valid values: `secrets`. + +#### provider + +The following arguments are supported in the `provider` configuration block: + +* `key_arn` - (Required) ARN of the Key Management Service (KMS) customer master key (CMK). The CMK must be symmetric, created in the same region as the cluster, and if the CMK was created in a different account, the user must have access to the CMK. For more information, see [Allowing Users in Other Accounts to Use a CMK in the AWS Key Management Service Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying-external-accounts.html). + +### vpc_config Arguments + +* `endpoint_private_access` - (Optional) Whether the Amazon EKS private API server endpoint is enabled. Default is `false`. +* `endpoint_public_access` - (Optional) Whether the Amazon EKS public API server endpoint is enabled. Default is `true`. +* `public_access_cidrs` - (Optional) List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint when enabled. EKS defaults this to a list with `0.0.0.0/0`. Terraform will only perform drift detection of its value when present in a configuration. +* `security_group_ids` – (Optional) List of security group IDs for the cross-account elastic network interfaces that Amazon EKS creates to use to allow communication between your worker nodes and the Kubernetes control plane. +* `subnet_ids` – (Required) List of subnet IDs. Must be in at least two different availability zones. Amazon EKS creates cross-account elastic network interfaces in these subnets to allow communication between your worker nodes and the Kubernetes control plane. + +### kubernetes_network_config + +The following arguments are supported in the `kubernetes_network_config` configuration block: + +* `service_ipv4_cidr` - (Optional) The CIDR block to assign Kubernetes pod and service IP addresses from. If you don't specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify a custom CIDR block when you create a cluster, changing this value will force a new cluster to be created. The block must meet the following requirements: + + * Within one of the following private IP address blocks: 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16. + + * Doesn't overlap with any CIDR block assigned to the VPC that you selected for VPC. + + * Between /24 and /12. +* `ip_family` - (Optional) The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`. You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created. + +### outpost_config + +The following arguments are supported in the `outpost_config` configuration block: + +* `control_plane_instance_type` - (Required) The Amazon EC2 instance type that you want to use for your local Amazon EKS cluster on Outposts. The instance type that you specify is used for all Kubernetes control plane instances. The instance type can't be changed after cluster creation. Choose an instance type based on the number of nodes that your cluster will have. If your cluster will have: + + * 1–20 nodes, then we recommend specifying a large instance type. + + * 21–100 nodes, then we recommend specifying an xlarge instance type. + + * 101–250 nodes, then we recommend specifying a 2xlarge instance type. + + For a list of the available Amazon EC2 instance types, see Compute and storage in AWS Outposts rack features The control plane is not automatically scaled by Amazon EKS. + +* `control_plane_placement` - (Optional) An object representing the placement configuration for all the control plane instances of your local Amazon EKS cluster on AWS Outpost. +The following arguments are supported in the `control_plane_placement` configuration block: + + * `group_name` - (Required) The name of the placement group for the Kubernetes control plane instances. This setting can't be changed after cluster creation. + +* `outpost_arns` - (Required) The ARN of the Outpost that you want to use for your local Amazon EKS cluster on Outposts. This argument is a list of arns, but only a single Outpost ARN is supported currently. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the cluster. +* `certificate_authority` - Attribute block containing `certificate-authority-data` for your cluster. Detailed below. +* `cluster_id` - The ID of your local Amazon EKS cluster on the AWS Outpost. This attribute isn't available for an AWS EKS cluster on AWS cloud. +* `created_at` - Unix epoch timestamp in seconds for when the cluster was created. +* `endpoint` - Endpoint for your Kubernetes API server. +* `id` - Name of the cluster. +* `identity` - Attribute block containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. Detailed below. +* `kubernetes_network_config.service_ipv6_cidr` - The CIDR block that Kubernetes pod and service IP addresses are assigned from if you specified `ipv6` for ipFamily when you created the cluster. Kubernetes assigns service addresses from the unique local address range (fc00::/7) because you can't specify a custom IPv6 CIDR block when you create the cluster. +* `platform_version` - Platform version for the cluster. +* `status` - Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED`. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `vpc_config` - Configuration block _argument_ that also includes attributes for the VPC associated with your cluster. Detailed below. + +### certificate_authority + +* `data` - Base64 encoded certificate data required to communicate with your cluster. Add this to the `certificate-authority-data` section of the `kubeconfig` file for your cluster. + +### identity + +* `oidc` - Nested block containing [OpenID Connect](https://openid.net/connect/) identity provider information for the cluster. Detailed below. + +### oidc + +* `issuer` - Issuer URL for the OpenID Connect identity provider. + +### vpc_config Attributes + +* `cluster_security_group_id` - Cluster security group that was created by Amazon EKS for the cluster. Managed node groups use this security group for control-plane-to-data-plane communication. +* `vpc_id` - ID of the VPC associated with your cluster. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `30m`) +* `update` - (Default `60m`) +Note that the `update` timeout is used separately for both `version` and `vpc_config` update timeouts. +* `delete` - (Default `15m`) + +## Import + +EKS Clusters can be imported using the `name`, e.g., + +``` +$ terraform import aws_eks_cluster.my_cluster my_cluster +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/eks_fargate_profile.html.markdown b/website/docs/cdktf/python/r/eks_fargate_profile.html.markdown new file mode 100644 index 00000000000..74693367dcc --- /dev/null +++ b/website/docs/cdktf/python/r/eks_fargate_profile.html.markdown @@ -0,0 +1,125 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_fargate_profile" +description: |- + Manages an EKS Fargate Profile +--- + + + +# Resource: aws_eks_fargate_profile + +Manages an EKS Fargate Profile. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_fargate_profile import EksFargateProfile +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + EksFargateProfile(self, "example", + cluster_name=Token.as_string(aws_eks_cluster_example.name), + fargate_profile_name="example", + pod_execution_role_arn=Token.as_string(aws_iam_role_example.arn), + selector=[EksFargateProfileSelector( + namespace="example" + ) + ], + subnet_ids=Token.as_list(property_access(aws_subnet_example, ["*", "id"])) + ) +``` + +### Example IAM Role for EKS Fargate Profile + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.iam_role import IamRole +from imports.aws.iam_role_policy_attachment import IamRolePolicyAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = IamRole(self, "example", + assume_role_policy=Token.as_string( + Fn.jsonencode({ + "Statement": [{ + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "eks-fargate-pods.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + })), + name="eks-fargate-profile-example" + ) + IamRolePolicyAttachment(self, "example-AmazonEKSFargatePodExecutionRolePolicy", + policy_arn="arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy", + role=example.name + ) +``` + +## Argument Reference + +The following arguments are required: + +* `cluster_name` – (Required) Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). +* `fargate_profile_name` – (Required) Name of the EKS Fargate Profile. +* `pod_execution_role_arn` – (Required) Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile. +* `selector` - (Required) Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below. +* `subnet_ids` – (Required) Identifiers of private EC2 Subnets to associate with the EKS Fargate Profile. These subnets must have the following resource tag: `kubernetes.io/cluster/CLUSTER_NAME` (where `CLUSTER_NAME` is replaced with the name of the EKS Cluster). + +The following arguments are optional: + +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### selector Configuration Block + +The following arguments are required: + +* `namespace` - (Required) Kubernetes namespace for selection. + +The following arguments are optional: + +* `labels` - (Optional) Key-value map of Kubernetes labels for selection. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the EKS Fargate Profile. +* `id` - EKS Cluster name and EKS Fargate Profile name separated by a colon (`:`). +* `status` - Status of the EKS Fargate Profile. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `10m`) +* `delete` - (Default `10m`) + +## Import + +EKS Fargate Profiles can be imported using the `cluster_name` and `fargate_profile_name` separated by a colon (`:`), e.g., + +``` +$ terraform import aws_eks_fargate_profile.my_fargate_profile my_cluster:my_fargate_profile +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/eks_identity_provider_config.html.markdown b/website/docs/cdktf/python/r/eks_identity_provider_config.html.markdown new file mode 100644 index 00000000000..034ad645f35 --- /dev/null +++ b/website/docs/cdktf/python/r/eks_identity_provider_config.html.markdown @@ -0,0 +1,82 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_identity_provider_config" +description: |- + Manages an EKS Identity Provider Configuration. +--- + + + +# Resource: aws_eks_identity_provider_config + +Manages an EKS Identity Provider Configuration. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_identity_provider_config import EksIdentityProviderConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + EksIdentityProviderConfig(self, "example", + cluster_name=Token.as_string(aws_eks_cluster_example.name), + oidc=EksIdentityProviderConfigOidc( + client_id="your client_id", + identity_provider_config_name="example", + issuer_url="your issuer_url" + ) + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `cluster_name` – (Required) Name of the EKS Cluster. +* `oidc` - (Required) Nested attribute containing [OpenID Connect](https://openid.net/connect/) identity provider information for the cluster. Detailed below. +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### oidc Configuration Block + +* `client_id` – (Required) Client ID for the OpenID Connect identity provider. +* `groups_claim` - (Optional) The JWT claim that the provider will use to return groups. +* `groups_prefix` - (Optional) A prefix that is prepended to group claims e.g., `oidc:`. +* `identity_provider_config_name` – (Required) The name of the identity provider config. +* `issuer_url` - (Required) Issuer URL for the OpenID Connect identity provider. +* `required_claims` - (Optional) The key value pairs that describe required claims in the identity token. +* `username_claim` - (Optional) The JWT claim that the provider will use as the username. +* `username_prefix` - (Optional) A prefix that is prepended to username claims. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the EKS Identity Provider Configuration. +* `id` - EKS Cluster name and EKS Identity Provider Configuration name separated by a colon (`:`). +* `status` - Status of the EKS Identity Provider Configuration. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `40m`) +* `delete` - (Default `40m`) + +## Import + +EKS Identity Provider Configurations can be imported using the `cluster_name` and `identity_provider_config_name` separated by a colon (`:`), e.g., + +``` +$ terraform import aws_eks_identity_provider_config.my_identity_provider_config my_cluster:my_identity_provider_config +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/eks_node_group.html.markdown b/website/docs/cdktf/python/r/eks_node_group.html.markdown new file mode 100644 index 00000000000..92d29f0b0b1 --- /dev/null +++ b/website/docs/cdktf/python/r/eks_node_group.html.markdown @@ -0,0 +1,278 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_node_group" +description: |- + Manages an EKS Node Group +--- + + + +# Resource: aws_eks_node_group + +Manages an EKS Node Group, which can provision and optionally update an Auto Scaling Group of Kubernetes worker nodes compatible with EKS. Additional documentation about this functionality can be found in the [EKS User Guide](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html). + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_node_group import EksNodeGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + EksNodeGroup(self, "example", + cluster_name=Token.as_string(aws_eks_cluster_example.name), + depends_on=[example_amazon_eks_worker_node_policy, example_amazon_eks_cni_policy, example_amazon_ec2_container_registry_read_only + ], + node_group_name="example", + node_role_arn=Token.as_string(aws_iam_role_example.arn), + scaling_config=EksNodeGroupScalingConfig( + desired_size=1, + max_size=2, + min_size=1 + ), + subnet_ids=Token.as_list(property_access(aws_subnet_example, ["*", "id"])), + update_config=EksNodeGroupUpdateConfig( + max_unavailable=1 + ) + ) +``` + +### Ignoring Changes to Desired Size + +You can utilize the generic Terraform resource [lifecycle configuration block](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html) with `ignore_changes` to create an EKS Node Group with an initial size of running instances, then ignore any changes to that count caused externally (e.g., Application Autoscaling). + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from cdktf import TerraformResourceLifecycle +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.eks_node_group import EksNodeGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, maxSize, minSize, clusterName, nodeRoleArn, subnetIds): + super().__init__(scope, name) + EksNodeGroup(self, "example", + lifecycle=TerraformResourceLifecycle( + ignore_changes=[d0.desired_size] + ), + scaling_config=EksNodeGroupScalingConfig( + desired_size=2, + max_size=max_size, + min_size=min_size + ), + cluster_name=cluster_name, + node_role_arn=node_role_arn, + subnet_ids=subnet_ids + ) +``` + +### Tracking the latest EKS Node Group AMI releases + +You can have the node group track the latest version of the Amazon EKS optimized Amazon Linux AMI for a given EKS version by querying an Amazon provided SSM parameter. Replace `amazon-linux-2` in the parameter name below with `amazon-linux-2-gpu` to retrieve the accelerated AMI version and `amazon-linux-2-arm64` to retrieve the Arm version. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, Fn, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ssm_parameter import DataAwsSsmParameter +from imports.aws.eks_node_group import EksNodeGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, scalingConfig): + super().__init__(scope, name) + eks_ami_release_version = DataAwsSsmParameter(self, "eks_ami_release_version", + name="/aws/service/eks/optimized-ami/${" + example.version + "}/amazon-linux-2/recommended/release_version" + ) + EksNodeGroup(self, "example", + cluster_name=example.name, + node_group_name="example", + node_role_arn=Token.as_string(aws_iam_role_example.arn), + release_version=Token.as_string( + Fn.nonsensitive(eks_ami_release_version.value)), + subnet_ids=Token.as_list(property_access(aws_subnet_example, ["*", "id"])), + version=example.version, + scaling_config=scaling_config + ) +``` + +### Example IAM Role for EKS Node Group + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.iam_role import IamRole +from imports.aws.iam_role_policy_attachment import IamRolePolicyAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = IamRole(self, "example", + assume_role_policy=Token.as_string( + Fn.jsonencode({ + "Statement": [{ + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + })), + name="eks-node-group-example" + ) + IamRolePolicyAttachment(self, "example-AmazonEC2ContainerRegistryReadOnly", + policy_arn="arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", + role=example.name + ) + IamRolePolicyAttachment(self, "example-AmazonEKSWorkerNodePolicy", + policy_arn="arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", + role=example.name + ) + IamRolePolicyAttachment(self, "example-AmazonEKS_CNI_Policy", + policy_arn="arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", + role=example.name + ) +``` + +### Example Subnets for EKS Node Group + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformCount, property_access, Fn, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_availability_zones import DataAwsAvailabilityZones +from imports.aws.subnet import Subnet +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + available = DataAwsAvailabilityZones(self, "available", + state="available" + ) + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + example_count = TerraformCount.of(Token.as_number("2")) + Subnet(self, "example", + availability_zone=Token.as_string( + property_access(available.names, [example_count.index])), + cidr_block=Token.as_string( + Fn.cidrsubnet( + Token.as_string(aws_vpc_example.cidr_block), 8, + Token.as_number(example_count.index))), + vpc_id=Token.as_string(aws_vpc_example.id), + count=example_count + ) +``` + +## Argument Reference + +The following arguments are required: + +* `cluster_name` – (Required) Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). +* `node_role_arn` – (Required) Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group. +* `scaling_config` - (Required) Configuration block with scaling settings. See [`scaling_config`](#scaling_config-configuration-block) below for details. +* `subnet_ids` – (Required) Identifiers of EC2 Subnets to associate with the EKS Node Group. + +The following arguments are optional: + +* `ami_type` - (Optional) Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values. Terraform will only perform drift detection if a configuration value is provided. +* `capacity_type` - (Optional) Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`. Terraform will only perform drift detection if a configuration value is provided. +* `disk_size` - (Optional) Disk size in GiB for worker nodes. Defaults to `50` for Windows, `20` all other node groups. Terraform will only perform drift detection if a configuration value is provided. +* `force_update_version` - (Optional) Force version update if existing pods are unable to be drained due to a pod disruption budget issue. +* `instance_types` - (Optional) List of instance types associated with the EKS Node Group. Defaults to `["t3.medium"]`. Terraform will only perform drift detection if a configuration value is provided. +* `labels` - (Optional) Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed. +* `launch_template` - (Optional) Configuration block with Launch Template settings. See [`launch_template`](#launch_template-configuration-block) below for details. +* `node_group_name` – (Optional) Name of the EKS Node Group. If omitted, Terraform will assign a random, unique name. Conflicts with `node_group_name_prefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters. +* `node_group_name_prefix` – (Optional) Creates a unique name beginning with the specified prefix. Conflicts with `node_group_name`. +* `release_version` – (Optional) AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version. +* `remote_access` - (Optional) Configuration block with remote access settings. See [`remote_access`](#remote_access-configuration-block) below for details. +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `taint` - (Optional) The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. See [taint](#taint-configuration-block) below for details. +* `update_config` - (Optional) Configuration block with update settings. See [`update_config`](#update_config-configuration-block) below for details. +* `version` – (Optional) Kubernetes version. Defaults to EKS Cluster Kubernetes version. Terraform will only perform drift detection if a configuration value is provided. + +### launch_template Configuration Block + +~> **NOTE:** Either `id` or `name` must be specified. + +* `id` - (Optional) Identifier of the EC2 Launch Template. Conflicts with `name`. +* `name` - (Optional) Name of the EC2 Launch Template. Conflicts with `id`. +* `version` - (Required) EC2 Launch Template version number. While the API accepts values like `$Default` and `$Latest`, the API will convert the value to the associated version number (e.g., `1`) on read and Terraform will show a difference on next plan. Using the `default_version` or `latest_version` attribute of the `aws_launch_template` resource or data source is recommended for this argument. + +### remote_access Configuration Block + +* `ec2_ssh_key` - (Optional) EC2 Key Pair name that provides access for remote communication with the worker nodes in the EKS Node Group. If you specify this configuration, but do not specify `source_security_group_ids` when you create an EKS Node Group, either port 3389 for Windows, or port 22 for all other operating systems is opened on the worker nodes to the Internet (0.0.0.0/0). For Windows nodes, this will allow you to use RDP, for all others this allows you to SSH into the worker nodes. +* `source_security_group_ids` - (Optional) Set of EC2 Security Group IDs to allow SSH access (port 22) from on the worker nodes. If you specify `ec2_ssh_key`, but do not specify this configuration when you create an EKS Node Group, port 22 on the worker nodes is opened to the Internet (0.0.0.0/0). + +### scaling_config Configuration Block + +* `desired_size` - (Required) Desired number of worker nodes. +* `max_size` - (Required) Maximum number of worker nodes. +* `min_size` - (Required) Minimum number of worker nodes. + +### taint Configuration Block + +* `key` - (Required) The key of the taint. Maximum length of 63. +* `value` - (Optional) The value of the taint. Maximum length of 63. +* `effect` - (Required) The effect of the taint. Valid values: `NO_SCHEDULE`, `NO_EXECUTE`, `PREFER_NO_SCHEDULE`. + +### update_config Configuration Block + +The following arguments are mutually exclusive. + +* `max_unavailable` - (Optional) Desired max number of unavailable worker nodes during node group update. +* `max_unavailable_percentage` - (Optional) Desired max percentage of unavailable worker nodes during node group update. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the EKS Node Group. +* `id` - EKS Cluster name and EKS Node Group name separated by a colon (`:`). +* `resources` - List of objects containing information about underlying resources. + * `autoscaling_groups` - List of objects containing information about AutoScaling Groups. + * `name` - Name of the AutoScaling Group. + * `remote_access_security_group_id` - Identifier of the remote access EC2 Security Group. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `status` - Status of the EKS Node Group. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `60m`) +* `update` - (Default `60m`) +* `delete` - (Default `60m`) + +## Import + +EKS Node Groups can be imported using the `cluster_name` and `node_group_name` separated by a colon (`:`), e.g., + +``` +$ terraform import aws_eks_node_group.my_node_group my_cluster:my_node_group +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/instance.html.markdown b/website/docs/cdktf/python/r/instance.html.markdown new file mode 100644 index 00000000000..0c17c25a439 --- /dev/null +++ b/website/docs/cdktf/python/r/instance.html.markdown @@ -0,0 +1,505 @@ +--- +subcategory: "EC2 (Elastic Compute Cloud)" +layout: "aws" +page_title: "AWS: aws_instance" +description: |- + Provides an EC2 instance resource. This allows instances to be created, updated, and deleted. Instances also support provisioning. +--- + + + +# Resource: aws_instance + +Provides an EC2 instance resource. This allows instances to be created, updated, and deleted. Instances also support [provisioning](https://www.terraform.io/docs/provisioners/index.html). + +## Example Usage + +### Basic example using AMI lookup + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ami import DataAwsAmi +from imports.aws.instance import Instance +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + ubuntu = DataAwsAmi(self, "ubuntu", + filter=[DataAwsAmiFilter( + name="name", + values=["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] + ), DataAwsAmiFilter( + name="virtualization-type", + values=["hvm"] + ) + ], + most_recent=True, + owners=["099720109477"] + ) + Instance(self, "web", + ami=Token.as_string(ubuntu.id), + instance_type="t3.micro", + tags={ + "Name": "HelloWorld" + } + ) +``` + +### Spot instance example + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ami import DataAwsAmi +from imports.aws.instance import Instance +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + this_var = DataAwsAmi(self, "this", + filter=[DataAwsAmiFilter( + name="architecture", + values=["arm64"] + ), DataAwsAmiFilter( + name="name", + values=["al2023-ami-2023*"] + ) + ], + most_recent=True, + owners=["amazon"] + ) + aws_instance_this = Instance(self, "this_1", + ami=Token.as_string(this_var.id), + instance_market_options=InstanceInstanceMarketOptions( + spot_options=InstanceInstanceMarketOptionsSpotOptions( + max_price=Token.as_string(0.0031) + ) + ), + instance_type="t4g.nano", + tags={ + "Name": "test-spot" + } + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_instance_this.override_logical_id("this") +``` + +### Network and credit specification example + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.instance import Instance +from imports.aws.network_interface import NetworkInterface +from imports.aws.subnet import Subnet +from imports.aws.vpc import Vpc +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + my_vpc = Vpc(self, "my_vpc", + cidr_block="172.16.0.0/16", + tags={ + "Name": "tf-example" + } + ) + my_subnet = Subnet(self, "my_subnet", + availability_zone="us-west-2a", + cidr_block="172.16.10.0/24", + tags={ + "Name": "tf-example" + }, + vpc_id=my_vpc.id + ) + foo = NetworkInterface(self, "foo", + private_ips=["172.16.10.100"], + subnet_id=my_subnet.id, + tags={ + "Name": "primary_network_interface" + } + ) + aws_instance_foo = Instance(self, "foo_3", + ami="ami-005e54dee72cc1d00", + credit_specification=InstanceCreditSpecification( + cpu_credits="unlimited" + ), + instance_type="t2.micro", + network_interface=[InstanceNetworkInterface( + device_index=0, + network_interface_id=foo.id + ) + ] + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_instance_foo.override_logical_id("foo") +``` + +### CPU options example + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_ami import DataAwsAmi +from imports.aws.instance import Instance +from imports.aws.subnet import Subnet +from imports.aws.vpc import Vpc +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Vpc(self, "example", + cidr_block="172.16.0.0/16", + tags={ + "Name": "tf-example" + } + ) + amzn_linux2023_ami = DataAwsAmi(self, "amzn-linux-2023-ami", + filter=[DataAwsAmiFilter( + name="name", + values=["al2023-ami-2023.*-x86_64"] + ) + ], + most_recent=True, + owners=["amazon"] + ) + aws_subnet_example = Subnet(self, "example_2", + availability_zone="us-east-2a", + cidr_block="172.16.10.0/24", + tags={ + "Name": "tf-example" + }, + vpc_id=example.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_subnet_example.override_logical_id("example") + aws_instance_example = Instance(self, "example_3", + ami=Token.as_string(amzn_linux2023_ami.id), + cpu_options=InstanceCpuOptions( + core_count=2, + threads_per_core=2 + ), + instance_type="c6a.2xlarge", + subnet_id=Token.as_string(aws_subnet_example.id), + tags={ + "Name": "tf-example" + } + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_instance_example.override_logical_id("example") +``` + +### Host resource group or Licence Manager registered AMI example + +A host resource group is a collection of Dedicated Hosts that you can manage as a single entity. As you launch instances, License Manager allocates the hosts and launches instances on them based on the settings that you configured. You can add existing Dedicated Hosts to a host resource group and take advantage of automated host management through License Manager. + +-> **NOTE:** A dedicated host is automatically associated with a License Manager host resource group if **Allocate hosts automatically** is enabled. Otherwise, use the `host_resource_group_arn` argument to explicitly associate the instance with the host resource group. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.instance import Instance +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Instance(self, "this", + ami="ami-0dcc1e21636832c5d", + host_resource_group_arn="arn:aws:resource-groups:us-west-2:012345678901:group/win-testhost", + instance_type="m5.large", + tenancy="host" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `ami` - (Optional) AMI to use for the instance. Required unless `launch_template` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template. +* `associate_public_ip_address` - (Optional) Whether to associate a public IP address with an instance in a VPC. +* `availability_zone` - (Optional) AZ to start the instance in. + +* `capacity_reservation_specification` - (Optional) Describes an instance's Capacity Reservation targeting option. See [Capacity Reservation Specification](#capacity-reservation-specification) below for more details. + +-> **NOTE:** Changing `cpu_core_count` and/or `cpu_threads_per_core` will cause the resource to be destroyed and re-created. + +* `cpu_core_count` - (Optional, **Deprecated** use the `cpu_options` argument instead) Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. +* `cpu_options` - (Optional) The CPU options for the instance. See [CPU Options](#cpu-options) below for more details. +* `cpu_threads_per_core` - (Optional - has no effect unless `cpu_core_count` is also set, **Deprecated** use the `cpu_options` argument instead) If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. +* `credit_specification` - (Optional) Configuration block for customizing the credit specification of the instance. See [Credit Specification](#credit-specification) below for more details. Terraform will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type. +* `disable_api_stop` - (Optional) If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection). +* `disable_api_termination` - (Optional) If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination). +* `ebs_block_device` - (Optional) One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects. +* `ebs_optimized` - (Optional) If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information. +* `enclave_options` - (Optional) Enable Nitro Enclaves on launched instances. See [Enclave Options](#enclave-options) below for more details. +* `ephemeral_block_device` - (Optional) One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details. When accessing this as an attribute reference, it is a set of objects. +* `get_password_data` - (Optional) If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. +* `hibernation` - (Optional) If true, the launched EC2 instance will support hibernation. +* `host_id` - (Optional) ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. +* `host_resource_group_arn` - (Optional) ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`. +* `iam_instance_profile` - (Optional) IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`. +* `instance_initiated_shutdown_behavior` - (Optional) Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information. +* `instance_market_options` - (Optional) Describes the market (purchasing) option for the instances. See [Market Options](#market-options) below for details on attributes. +* `instance_type` - (Optional) Instance type to use for the instance. Required unless `launch_template` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instance_type` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance. +* `ipv6_address_count`- (Optional) Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. +* `ipv6_addresses` - (Optional) Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface +* `key_name` - (Optional) Key name of the Key Pair to use for the instance; which can be managed using [the `aws_key_pair` resource](key_pair.html). +* `launch_template` - (Optional) Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See [Launch Template Specification](#launch-template-specification) below for more details. +* `maintenance_options` - (Optional) Maintenance and recovery options for the instance. See [Maintenance Options](#maintenance-options) below for more details. +* `metadata_options` - (Optional) Customize the metadata options of the instance. See [Metadata Options](#metadata-options) below for more details. +* `monitoring` - (Optional) If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0) +* `network_interface` - (Optional) Customize network interfaces to be attached at instance boot time. See [Network Interfaces](#network-interfaces) below for more details. +* `placement_group` - (Optional) Placement Group to start the instance in. +* `placement_partition_number` - (Optional) Number of the partition the instance is in. Valid only if [the `aws_placement_group` resource's](placement_group.html) `strategy` argument is set to `"partition"`. +* `private_dns_name_options` - (Optional) Options for the instance hostname. The default values are inherited from the subnet. See [Private DNS Name Options](#private-dns-name-options) below for more details. +* `private_ip` - (Optional) Private IP address to associate with the instance in a VPC. +* `root_block_device` - (Optional) Configuration block to customize details about the root block device of the instance. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details. When accessing this as an attribute reference, it is a list containing one object. +* `secondary_private_ips` - (Optional) List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `network_interface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. +* `security_groups` - (Optional, EC2-Classic and default VPC only) List of security group names to associate with. + +-> **NOTE:** If you are creating Instances in a VPC, use `vpc_security_group_ids` instead. + +* `source_dest_check` - (Optional) Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. +* `subnet_id` - (Optional) VPC Subnet ID to launch in. +* `tags` - (Optional) Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `tenancy` - (Optional) Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`. +* `user_data` - (Optional) User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `user_data_base64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `user_data_replace_on_change` is set then updates to this field will trigger a destroy and recreate. +* `user_data_base64` - (Optional) Can be used instead of `user_data` to pass base64-encoded binary data directly. Use this instead of `user_data` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `user_data_replace_on_change` is set then updates to this field will trigger a destroy and recreate. +* `user_data_replace_on_change` - (Optional) When used in combination with `user_data` or `user_data_base64` will trigger a destroy and recreate when set to `true`. Defaults to `false` if not set. +* `volume_tags` - (Optional) Map of tags to assign, at instance-creation time, to root and EBS volumes. + +~> **NOTE:** Do not use `volume_tags` if you plan to manage block device tags outside the `aws_instance` configuration, such as using `tags` in an [`aws_ebs_volume`](/docs/providers/aws/r/ebs_volume.html) resource attached via [`aws_volume_attachment`](/docs/providers/aws/r/volume_attachment.html). Doing so will result in resource cycling and inconsistent behavior. + +* `vpc_security_group_ids` - (Optional, VPC only) List of security group IDs to associate with. + +### Capacity Reservation Specification + +~> **NOTE:** You can specify only one argument at a time. If you specify both `capacity_reservation_preference` and `capacity_reservation_target`, the request fails. Modifying `capacity_reservation_preference` or `capacity_reservation_target` in this block requires the instance to be in `stopped` state. + +Capacity reservation specification can be applied/modified to the EC2 Instance at creation time or when the instance is `stopped`. + +The `capacity_reservation_specification` block supports the following: + +* `capacity_reservation_preference` - (Optional) Indicates the instance's Capacity Reservation preferences. Can be `"open"` or `"none"`. (Default: `"open"`). +* `capacity_reservation_target` - (Optional) Information about the target Capacity Reservation. See [Capacity Reservation Target](#capacity-reservation-target) below for more details. + +For more information, see the documentation on [Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html). + +### Capacity Reservation Target + +~> **NOTE:** Modifying `capacity_reservation_id` in this block requires the instance to be in `stopped` state. + +Describes a target Capacity Reservation. + +This `capacity_reservation_target` block supports the following: + +* `capacity_reservation_id` - (Optional) ID of the Capacity Reservation in which to run the instance. +* `capacity_reservation_resource_group_arn` - (Optional) ARN of the Capacity Reservation resource group in which to run the instance. + +### CPU Options + +-> **NOTE:** Changing any of `amd_sev_snp`, `core_count`, `threads_per_core` will cause the resource to be destroyed and re-created. + +CPU options apply to the instance at launch time. + +The `cpu_options` block supports the following: + +* `amd_sev_snp` - (Optional) Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is supported with M6a, R6a, and C6a instance types only. Valid values are `enabled` and `disabled`. +* `core_count` - (Optional) Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. +* `threads_per_core` - (Optional - has no effect unless `core_count` is also set) If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. + +For more information, see the documentation on [Optimizing CPU options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html). + +### Credit Specification + +The `credit_specification` block supports the following: + +* `cpu_credits` - (Optional) Credit option for CPU usage. Valid values include `standard` or `unlimited`. T3 instances are launched as unlimited by default. T2 instances are launched as standard by default. + +### EBS, Ephemeral, and Root Block Devices + +Each of the `*_block_device` attributes control a portion of the EC2 Instance's "Block Device Mapping". For more information, see the [AWS Block Device Mapping documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html). + +The `root_block_device` block supports the following: + +* `delete_on_termination` - (Optional) Whether the volume should be destroyed on instance termination. Defaults to `true`. +* `encrypted` - (Optional) Whether to enable volume encryption. Defaults to `false`. Must be configured to perform drift detection. +* `iops` - (Optional) Amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). Only valid for volume_type of `io1`, `io2` or `gp3`. +* `kms_key_id` - (Optional) Amazon Resource Name (ARN) of the KMS Key to use when encrypting the volume. Must be configured to perform drift detection. +* `tags` - (Optional) Map of tags to assign to the device. +* `throughput` - (Optional) Throughput to provision for a volume in mebibytes per second (MiB/s). This is only valid for `volume_type` of `gp3`. +* `volume_size` - (Optional) Size of the volume in gibibytes (GiB). +* `volume_type` - (Optional) Type of volume. Valid values include `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1`, or `st1`. Defaults to `gp2`. + +Modifying the `encrypted` or `kms_key_id` settings of the `root_block_device` requires resource replacement. + +Each `ebs_block_device` block supports the following: + +* `delete_on_termination` - (Optional) Whether the volume should be destroyed on instance termination. Defaults to `true`. +* `device_name` - (Required) Name of the device to mount. +* `encrypted` - (Optional) Enables [EBS encryption](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) on the volume. Defaults to `false`. Cannot be used with `snapshot_id`. Must be configured to perform drift detection. +* `iops` - (Optional) Amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). Only valid for volume_type of `io1`, `io2` or `gp3`. +* `kms_key_id` - (Optional) Amazon Resource Name (ARN) of the KMS Key to use when encrypting the volume. Must be configured to perform drift detection. +* `snapshot_id` - (Optional) Snapshot ID to mount. +* `tags` - (Optional) Map of tags to assign to the device. +* `throughput` - (Optional) Throughput to provision for a volume in mebibytes per second (MiB/s). This is only valid for `volume_type` of `gp3`. +* `volume_size` - (Optional) Size of the volume in gibibytes (GiB). +* `volume_type` - (Optional) Type of volume. Valid values include `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1`, or `st1`. Defaults to `gp2`. + +~> **NOTE:** Currently, changes to the `ebs_block_device` configuration of _existing_ resources cannot be automatically detected by Terraform. To manage changes and attachments of an EBS block to an instance, use the `aws_ebs_volume` and `aws_volume_attachment` resources instead. If you use `ebs_block_device` on an `aws_instance`, Terraform will assume management over the full set of non-root EBS block devices for the instance, treating additional block devices as drift. For this reason, `ebs_block_device` cannot be mixed with external `aws_ebs_volume` and `aws_volume_attachment` resources for a given instance. + +Each `ephemeral_block_device` block supports the following: + +* `device_name` - Name of the block device to mount on the instance. +* `no_device` - (Optional) Suppresses the specified device included in the AMI's block device mapping. +* `virtual_name` - (Optional) [Instance Store Device Name](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#InstanceStoreDeviceNames) (e.g., `ephemeral0`). + +Each AWS Instance type has a different set of Instance Store block devices available for attachment. AWS [publishes a list](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#StorageOnInstanceTypes) of which ephemeral devices are available on each type. The devices are always identified by the `virtual_name` in the format `ephemeral{0..N}`. + +### Enclave Options + +-> **NOTE:** Changing `enabled` will cause the resource to be destroyed and re-created. + +Enclave options apply to the instance at boot time. + +The `enclave_options` block supports the following: + +* `enabled` - (Optional) Whether Nitro Enclaves will be enabled on the instance. Defaults to `false`. + +For more information, see the documentation on [Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html). + +### Maintenance Options + +The `maintenance_options` block supports the following: + +* `auto_recovery` - (Optional) Automatic recovery behavior of the Instance. Can be `"default"` or `"disabled"`. See [Recover your instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html) for more details. + +### Market Options + +The `instance_market_options` block supports the following: + +* `market_type` - (Optional) Type of market for the instance. Valid value is `spot`. Defaults to `spot`. +* `spot_options` - (Optional) Block to configure the options for Spot Instances. See [Spot Options](#spot-options) below for details on attributes. + +### Metadata Options + +Metadata options can be applied/modified to the EC2 Instance at any time. + +The `metadata_options` block supports the following: + +* `http_endpoint` - (Optional) Whether the metadata service is available. Valid values include `enabled` or `disabled`. Defaults to `enabled`. +* `http_put_response_hop_limit` - (Optional) Desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. Valid values are integer from `1` to `64`. Defaults to `1`. +* `http_tokens` - (Optional) Whether or not the metadata service requires session tokens, also referred to as _Instance Metadata Service Version 2 (IMDSv2)_. Valid values include `optional` or `required`. Defaults to `optional`. +* `instance_metadata_tags` - (Optional) Enables or disables access to instance tags from the instance metadata service. Valid values include `enabled` or `disabled`. Defaults to `disabled`. + +For more information, see the documentation on the [Instance Metadata Service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). + +### Network Interfaces + +Each of the `network_interface` blocks attach a network interface to an EC2 Instance during boot time. However, because the network interface is attached at boot-time, replacing/modifying the network interface **WILL** trigger a recreation of the EC2 Instance. If you should need at any point to detach/modify/re-attach a network interface to the instance, use the `aws_network_interface` or `aws_network_interface_attachment` resources instead. + +The `network_interface` configuration block _does_, however, allow users to supply their own network interface to be used as the default network interface on an EC2 Instance, attached at `eth0`. + +Each `network_interface` block supports the following: + +* `delete_on_termination` - (Optional) Whether or not to delete the network interface on instance termination. Defaults to `false`. Currently, the only valid value is `false`, as this is only supported when creating new network interfaces when launching an instance. +* `device_index` - (Required) Integer index of the network interface attachment. Limited by instance type. +* `network_card_index` - (Optional) Integer index of the network card. Limited by instance type. The default index is `0`. +* `network_interface_id` - (Required) ID of the network interface to attach. + +### Private DNS Name Options + +The `private_dns_name_options` block supports the following: + +* `enable_resource_name_dns_aaaa_record` - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. +* `enable_resource_name_dns_a_record` - Indicates whether to respond to DNS queries for instance hostnames with DNS A records. +* `hostname_type` - Type of hostname for Amazon EC2 instances. For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 native subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ip-name` and `resource-name`. + +### Spot Options + +The `spot_options` block supports the following: + +* `instance_interruption_behavior` - (Optional) The behavior when a Spot Instance is interrupted. Valid values include `hibernate`, `stop`, `terminate` . The default is `terminate`. +* `max_price` - (Optional) The maximum hourly price that you're willing to pay for a Spot Instance. +* `spot_instance_type` - (Optional) The Spot Instance request type. Valid values include `one-time`, `persistent`. Persistent Spot Instance requests are only supported when the instance interruption behavior is either hibernate or stop. The default is `one-time`. +* `valid_until` - (Optional) The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). Supported only for persistent requests. + +### Launch Template Specification + +-> **Note:** Launch Template parameters will be used only once during instance creation. If you want to update existing instance you need to change parameters +directly. Updating Launch Template specification will force a new instance. + +Any other instance parameters that you specify will override the same parameters in the launch template. + +The `launch_template` block supports the following: + +* `id` - ID of the launch template. Conflicts with `name`. +* `name` - Name of the launch template. Conflicts with `id`. +* `version` - Template version. Can be a specific version number, `$Latest` or `$Default`. The default value is `$Default`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the instance. +* `capacity_reservation_specification` - Capacity reservation specification of the instance. +* `instance_state` - State of the instance. One of: `pending`, `running`, `shutting-down`, `terminated`, `stopping`, `stopped`. See [Instance Lifecycle](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) for more information. +* `outpost_arn` - ARN of the Outpost the instance is assigned to. +* `password_data` - Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if `get_password_data` is true. Note that this encrypted value will be stored in the state file, as with all exported attributes. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. +* `primary_network_interface_id` - ID of the instance's primary network interface. +* `private_dns` - Private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC. +* `public_dns` - Public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC. +* `public_ip` - Public IP address assigned to the instance, if applicable. **NOTE**: If you are using an [`aws_eip`](/docs/providers/aws/r/eip.html) with your instance, you should refer to the EIP's address directly and not use `public_ip` as this field will change after the EIP is attached. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +For `ebs_block_device`, in addition to the arguments above, the following attribute is exported: + +* `volume_id` - ID of the volume. For example, the ID can be accessed like this, `aws_instance.web.ebs_block_device.2.volume_id`. + +For `root_block_device`, in addition to the arguments above, the following attributes are exported: + +* `volume_id` - ID of the volume. For example, the ID can be accessed like this, `aws_instance.web.root_block_device.0.volume_id`. +* `device_name` - Device name, e.g., `/dev/sdh` or `xvdh`. + +For `instance_market_options`, in addition to the arguments above, the following attributes are exported: + +* `instance_lifecycle` - Indicates whether this is a Spot Instance or a Scheduled Instance. +* `spot_instance_request_id` - If the request is a Spot Instance request, the ID of the request. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `10m`) +* `update` - (Default `10m`) +* `delete` - (Default `20m`) + +## Import + +Instances can be imported using the `id`, e.g., + +``` +$ terraform import aws_instance.web i-12345678 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_alias.html.markdown b/website/docs/cdktf/python/r/lambda_alias.html.markdown new file mode 100644 index 00000000000..fff13bc3d1e --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_alias.html.markdown @@ -0,0 +1,76 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_alias" +description: |- + Creates a Lambda function alias. +--- + + + +# Resource: aws_lambda_alias + +Creates a Lambda function alias. Creates an alias that points to the specified Lambda function version. + +For information about Lambda and how to use it, see [What is AWS Lambda?][1] +For information about function aliases, see [CreateAlias][2] and [AliasRoutingConfiguration][3] in the API docs. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_alias import LambdaAlias +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaAlias(self, "test_lambda_alias", + description="a sample description", + function_name=lambda_function_test.arn, + function_version="1", + name="my_alias", + routing_config=LambdaAliasRoutingConfig( + additional_version_weights={ + "2": 0.5 + } + ) + ) +``` + +## Argument Reference + +* `name` - (Required) Name for the alias you are creating. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` +* `description` - (Optional) Description of the alias. +* `function_name` - (Required) Lambda Function name or ARN. +* `function_version` - (Required) Lambda function version for which you are creating the alias. Pattern: `(\$LATEST|[0-9]+)`. +* `routing_config` - (Optional) The Lambda alias' route configuration settings. Fields documented below + +For **routing_config** the following attributes are supported: + +* `additional_version_weights` - (Optional) A map that defines the proportion of events that should be sent to different versions of a lambda function. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) identifying your Lambda function alias. +* `invoke_arn` - The ARN to be used for invoking Lambda Function from API Gateway - to be used in [`aws_api_gateway_integration`](/docs/providers/aws/r/api_gateway_integration.html)'s `uri` + +[1]: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html +[2]: http://docs.aws.amazon.com/lambda/latest/dg/API_CreateAlias.html +[3]: https://docs.aws.amazon.com/lambda/latest/dg/API_AliasRoutingConfiguration.html + +## Import + +Lambda Function Aliases can be imported using the `function_name/alias`, e.g., + +``` +$ terraform import aws_lambda_alias.test_lambda_alias my_test_lambda_function/my_alias +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_code_signing_config.html.markdown b/website/docs/cdktf/python/r/lambda_code_signing_config.html.markdown new file mode 100644 index 00000000000..c3b1d346f0f --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_code_signing_config.html.markdown @@ -0,0 +1,74 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_code_signing_config" +description: |- + Provides a Lambda Code Signing Config resource. +--- + + + +# Resource: aws_lambda_code_signing_config + +Provides a Lambda Code Signing Config resource. A code signing configuration defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if deployment validation checks fail). + +For information about Lambda code signing configurations and how to use them, see [configuring code signing for Lambda functions][1] + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_code_signing_config import LambdaCodeSigningConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaCodeSigningConfig(self, "new_csc", + allowed_publishers=LambdaCodeSigningConfigAllowedPublishers( + signing_profile_version_arns=[example1.arn, example2.arn] + ), + description="My awesome code signing config.", + policies=LambdaCodeSigningConfigPolicies( + untrusted_artifact_on_deployment="Warn" + ) + ) +``` + +## Argument Reference + +* `allowed_publishers` (Required) A configuration block of allowed publishers as signing profiles for this code signing configuration. Detailed below. +* `policies` (Optional) A configuration block of code signing policies that define the actions to take if the validation checks fail. Detailed below. +* `description` - (Optional) Descriptive name for this code signing configuration. + +The `allowed_publishers` block supports the following argument: + +* `signing_profile_version_arns` - (Required) The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package. + +The `policies` block supports the following argument: + +* `untrusted_artifact_on_deployment` - (Required) Code signing configuration policy for deployment validation failure. If you set the policy to Enforce, Lambda blocks the deployment request if code-signing validation checks fail. If you set the policy to Warn, Lambda allows the deployment and creates a CloudWatch log. Valid values: `Warn`, `Enforce`. Default value: `Warn`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the code signing configuration. +* `config_id` - Unique identifier for the code signing configuration. +* `last_modified` - The date and time that the code signing configuration was last modified. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html + +## Import + +Code Signing Configs can be imported using their ARN, e.g., + +``` +$ terraform import aws_lambda_code_signing_config.imported_csc arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0f6c334abcdea4d8b +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_event_source_mapping.html.markdown b/website/docs/cdktf/python/r/lambda_event_source_mapping.html.markdown new file mode 100644 index 00000000000..f10e3ef4f40 --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_event_source_mapping.html.markdown @@ -0,0 +1,326 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_event_source_mapping" +description: |- + Provides a Lambda event source mapping. This allows Lambda functions to get events from Kinesis, DynamoDB, SQS, Amazon MQ and Managed Streaming for Apache Kafka (MSK). +--- + + + +# Resource: aws_lambda_event_source_mapping + +Provides a Lambda event source mapping. This allows Lambda functions to get events from Kinesis, DynamoDB, SQS, Amazon MQ and Managed Streaming for Apache Kafka (MSK). + +For information about Lambda and how to use it, see [What is AWS Lambda?][1]. +For information about event source mappings, see [CreateEventSourceMapping][2] in the API docs. + +## Example Usage + +### DynamoDB + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_event_source_mapping import LambdaEventSourceMapping +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaEventSourceMapping(self, "example", + event_source_arn=Token.as_string(aws_dynamodb_table_example.stream_arn), + function_name=Token.as_string(aws_lambda_function_example.arn), + starting_position="LATEST" + ) +``` + +### Kinesis + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_event_source_mapping import LambdaEventSourceMapping +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaEventSourceMapping(self, "example", + event_source_arn=Token.as_string(aws_kinesis_stream_example.arn), + function_name=Token.as_string(aws_lambda_function_example.arn), + starting_position="LATEST" + ) +``` + +### Managed Streaming for Apache Kafka (MSK) + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_event_source_mapping import LambdaEventSourceMapping +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaEventSourceMapping(self, "example", + event_source_arn=Token.as_string(aws_msk_cluster_example.arn), + function_name=Token.as_string(aws_lambda_function_example.arn), + starting_position="TRIM_HORIZON", + topics=["Example"] + ) +``` + +### Self Managed Apache Kafka + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_event_source_mapping import LambdaEventSourceMapping +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaEventSourceMapping(self, "example", + function_name=Token.as_string(aws_lambda_function_example.arn), + self_managed_event_source=LambdaEventSourceMappingSelfManagedEventSource( + endpoints={ + "KAFKA_BOOTSTRAP_SERVERS": "kafka1.example.com:9092,kafka2.example.com:9092" + } + ), + source_access_configuration=[LambdaEventSourceMappingSourceAccessConfiguration( + type="VPC_SUBNET", + uri="subnet:subnet-example1" + ), LambdaEventSourceMappingSourceAccessConfiguration( + type="VPC_SUBNET", + uri="subnet:subnet-example2" + ), LambdaEventSourceMappingSourceAccessConfiguration( + type="VPC_SECURITY_GROUP", + uri="security_group:sg-example" + ) + ], + starting_position="TRIM_HORIZON", + topics=["Example"] + ) +``` + +### SQS + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_event_source_mapping import LambdaEventSourceMapping +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaEventSourceMapping(self, "example", + event_source_arn=sqs_queue_test.arn, + function_name=Token.as_string(aws_lambda_function_example.arn) + ) +``` + +### SQS with event filter + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_event_source_mapping import LambdaEventSourceMapping +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaEventSourceMapping(self, "example", + event_source_arn=sqs_queue_test.arn, + filter_criteria=LambdaEventSourceMappingFilterCriteria( + filter=[LambdaEventSourceMappingFilterCriteriaFilter( + pattern=Token.as_string( + Fn.jsonencode({ + "body": { + "Location": ["New York"], + "Temperature": [{ + "numeric": [">", 0, "<=", 100] + } + ] + } + })) + ) + ] + ), + function_name=Token.as_string(aws_lambda_function_example.arn) + ) +``` + +### Amazon MQ (ActiveMQ) + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_event_source_mapping import LambdaEventSourceMapping +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaEventSourceMapping(self, "example", + batch_size=10, + enabled=True, + event_source_arn=Token.as_string(aws_mq_broker_example.arn), + function_name=Token.as_string(aws_lambda_function_example.arn), + queues=["example"], + source_access_configuration=[LambdaEventSourceMappingSourceAccessConfiguration( + type="BASIC_AUTH", + uri=Token.as_string(aws_secretsmanager_secret_version_example.arn) + ) + ] + ) +``` + +### Amazon MQ (RabbitMQ) + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_event_source_mapping import LambdaEventSourceMapping +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaEventSourceMapping(self, "example", + batch_size=1, + enabled=True, + event_source_arn=Token.as_string(aws_mq_broker_example.arn), + function_name=Token.as_string(aws_lambda_function_example.arn), + queues=["example"], + source_access_configuration=[LambdaEventSourceMappingSourceAccessConfiguration( + type="VIRTUAL_HOST", + uri="/example" + ), LambdaEventSourceMappingSourceAccessConfiguration( + type="BASIC_AUTH", + uri=Token.as_string(aws_secretsmanager_secret_version_example.arn) + ) + ] + ) +``` + +## Argument Reference + +* `amazon_managed_kafka_event_source_config` - (Optional) Additional configuration block for Amazon Managed Kafka sources. Incompatible with "self_managed_event_source" and "self_managed_kafka_event_source_config". Detailed below. +* `batch_size` - (Optional) The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to `100` for DynamoDB, Kinesis, MQ and MSK, `10` for SQS. +* `bisect_batch_on_function_error`: - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`. +* `destination_config`: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below. +* `document_db_event_source_config`: - (Optional) Configuration settings for a DocumentDB event source. Detailed below. +* `enabled` - (Optional) Determines if the mapping will be enabled on creation. Defaults to `true`. +* `event_source_arn` - (Optional) The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker, MSK cluster or DocumentDB change stream. It is incompatible with a Self Managed Kafka source. +* `filter_criteria` - (Optional) The criteria to use for [event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) Kinesis stream, DynamoDB stream, SQS queue event sources. Detailed below. +* `function_name` - (Required) The name or the ARN of the Lambda function that will be subscribing to events. +* `function_response_types` - (Optional) A list of current response type enums applied to the event source mapping for [AWS Lambda checkpointing](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting). Only available for SQS and stream sources (DynamoDB and Kinesis). Valid values: `ReportBatchItemFailures`. +* `maximum_batching_window_in_seconds` - (Optional) The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300). Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either `maximum_batching_window_in_seconds` expires or `batch_size` has been met. For streaming event sources, defaults to as soon as records are available in the stream. If the batch it reads from the stream/queue only has one record in it, Lambda only sends one record to the function. Only available for stream sources (DynamoDB and Kinesis) and SQS standard queues. +* `maximum_record_age_in_seconds`: - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). +* `maximum_retry_attempts`: - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. +* `parallelization_factor`: - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. +* `queues` - (Optional) The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. A single queue name must be specified. +* `scaling_config` - (Optional) Scaling configuration of the event source. Only available for SQS queues. Detailed below. +* `self_managed_event_source`: - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `source_access_configuration`. Detailed below. +* `self_managed_kafka_event_source_config` - (Optional) Additional configuration block for Self Managed Kafka sources. Incompatible with "event_source_arn" and "amazon_managed_kafka_event_source_config". Detailed below. +* `source_access_configuration`: (Optional) For Self Managed Kafka sources, the access configuration for the source. If set, configuration must also include `self_managed_event_source`. Detailed below. +* `starting_position` - (Optional) The position in the stream where AWS Lambda should start reading. Must be one of `AT_TIMESTAMP` (Kinesis only), `LATEST` or `TRIM_HORIZON` if getting events from Kinesis, DynamoDB, MSK or Self Managed Apache Kafka. Must not be provided if getting events from SQS. More information about these positions can be found in the [AWS DynamoDB Streams API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) and [AWS Kinesis API Reference](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType). +* `starting_position_timestamp` - (Optional) A timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of the data record which to start reading when using `starting_position` set to `AT_TIMESTAMP`. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen. +* `topics` - (Optional) The name of the Kafka topics. Only available for MSK sources. A single topic name must be specified. +* `tumbling_window_in_seconds` - (Optional) The duration in seconds of a processing window for [AWS Lambda streaming analytics](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows). The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis). + +### amazon_managed_kafka_event_source_config Configuration Block + +* `consumer_group_id` - (Optional) A Kafka consumer group ID between 1 and 200 characters for use when creating this event source mapping. If one is not specified, this value will be automatically generated. See [AmazonManagedKafkaEventSourceConfig Syntax](https://docs.aws.amazon.com/lambda/latest/dg/API_AmazonManagedKafkaEventSourceConfig.html). + +### destination_config Configuration Block + +* `on_failure` - (Optional) The destination configuration for failed invocations. Detailed below. + +#### destination_config on_failure Configuration Block + +* `destination_arn` - (Required) The Amazon Resource Name (ARN) of the destination resource. + +### document_db_event_source_config Configuration Block + +* `collection_name` - (Optional) The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections. +* `database_name` - (Required) The name of the database to consume within the DocumentDB cluster. +* `full_document` - (Optional) Determines what DocumentDB sends to your event stream during document update operations. If set to `UpdateLookup`, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes. Valid values: `UpdateLookup`, `Default`. + +### filter_criteria Configuration Block + +* `filter` - (Optional) A set of up to 5 filter. If an event satisfies at least one, Lambda sends the event to the function or adds it to the next batch. Detailed below. + +#### filter_criteria filter Configuration Block + +* `pattern` - (Optional) A filter pattern up to 4096 characters. See [Filter Rule Syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax). + +### scaling_config Configuration Block + +* `maximum_concurrency` - (Optional) Limits the number of concurrent instances that the Amazon SQS event source can invoke. Must be between `2` and `1000`. See [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + +### self_managed_event_source Configuration Block + +* `endpoints` - (Required) A map of endpoints for the self managed source. For Kafka self-managed sources, the key should be `KAFKA_BOOTSTRAP_SERVERS` and the value should be a string with a comma separated list of broker endpoints. + +### self_managed_kafka_event_source_config Configuration Block + +* `consumer_group_id` - (Optional) A Kafka consumer group ID between 1 and 200 characters for use when creating this event source mapping. If one is not specified, this value will be automatically generated. See [SelfManagedKafkaEventSourceConfig Syntax](https://docs.aws.amazon.com/lambda/latest/dg/API_SelfManagedKafkaEventSourceConfig.html). + +### source_access_configuration Configuration Block + +* `type` - (Required) The type of this configuration. For Self Managed Kafka you will need to supply blocks for type `VPC_SUBNET` and `VPC_SECURITY_GROUP`. +* `uri` - (Required) The URI for this configuration. For type `VPC_SUBNET` the value should be `subnet:subnet_id` where `subnet_id` is the value you would find in an aws_subnet resource's id attribute. For type `VPC_SECURITY_GROUP` the value should be `security_group:security_group_id` where `security_group_id` is the value you would find in an aws_security_group resource's id attribute. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `function_arn` - The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from `function_name` above.) +* `last_modified` - The date this resource was last modified. +* `last_processing_result` - The result of the last AWS Lambda invocation of your Lambda function. +* `state` - The state of the event source mapping. +* `state_transition_reason` - The reason the event source mapping is in its current state. +* `uuid` - The UUID of the created event source mapping. + +[1]: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html +[2]: http://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html + +## Import + +Lambda event source mappings can be imported using the `UUID` (event source mapping identifier), e.g., + +``` +$ terraform import aws_lambda_event_source_mapping.event_source_mapping 12345kxodurf3443 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_function.html.markdown b/website/docs/cdktf/python/r/lambda_function.html.markdown new file mode 100644 index 00000000000..576e1278246 --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_function.html.markdown @@ -0,0 +1,418 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function" +description: |- + Provides a Lambda Function resource. Lambda allows you to trigger execution of code in response to events in AWS, enabling serverless backend solutions. The Lambda Function itself includes source code and runtime configuration. +--- + + + +# Resource: aws_lambda_function + +Provides a Lambda Function resource. Lambda allows you to trigger execution of code in response to events in AWS, enabling serverless backend solutions. The Lambda Function itself includes source code and runtime configuration. + +For information about Lambda and how to use it, see [What is AWS Lambda?][1] + +For a detailed example of setting up Lambda and API Gateway, see [Serverless Applications with AWS Lambda and API Gateway.][11] + +~> **NOTE:** Due to [AWS Lambda improved VPC networking changes that began deploying in September 2019](https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/), EC2 subnets and security groups associated with Lambda Functions can take up to 45 minutes to successfully delete. Terraform AWS Provider version 2.31.0 and later automatically handles this increased timeout, however prior versions require setting the customizable deletion timeouts of those Terraform resources to 45 minutes (`delete = "45m"`). AWS and HashiCorp are working together to reduce the amount of time required for resource deletion and updates can be tracked in this [GitHub issue](https://github.com/hashicorp/terraform-provider-aws/issues/10329). + +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + +-> To give an external source (like an EventBridge Rule, SNS, or S3) permission to access the Lambda function, use the [`aws_lambda_permission`](lambda_permission.html) resource. See [Lambda Permission Model][4] for more details. On the other hand, the `role` argument of this resource is the function's execution role for identity and access to AWS services and resources. + +## Example Usage + +### Basic Example + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.archive.data_archive_file import DataArchiveFile +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.iam_role import IamRole +from imports.aws.lambda_function import LambdaFunction +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # The following providers are missing schema information and might need manual adjustments to synthesize correctly: archive. + # For a more precise conversion please use the --provider flag in convert. + lambda_ = DataArchiveFile(self, "lambda", + output_path="lambda_function_payload.zip", + source_file="lambda.js", + type="zip" + ) + assume_role = DataAwsIamPolicyDocument(self, "assume_role", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["sts:AssumeRole"], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=["lambda.amazonaws.com"], + type="Service" + ) + ] + ) + ] + ) + iam_for_lambda = IamRole(self, "iam_for_lambda", + assume_role_policy=Token.as_string(assume_role.json), + name="iam_for_lambda" + ) + LambdaFunction(self, "test_lambda", + environment=LambdaFunctionEnvironment( + variables={ + "foo": "bar" + } + ), + filename="lambda_function_payload.zip", + function_name="lambda_function_name", + handler="index.test", + role=iam_for_lambda.arn, + runtime="nodejs16.x", + source_code_hash=Token.as_string(lambda_.output_base64_sha256) + ) +``` + +### Lambda Layers + +~> **NOTE:** The `aws_lambda_layer_version` attribute values for `arn` and `layer_arn` were swapped in version 2.0.0 of the Terraform AWS Provider. For version 1.x, use `layer_arn` references. For version 2.x, use `arn` references. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_function import LambdaFunction +from imports.aws.lambda_layer_version import LambdaLayerVersion +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, layerName, functionName, role): + super().__init__(scope, name) + example = LambdaLayerVersion(self, "example", + layer_name=layer_name + ) + aws_lambda_function_example = LambdaFunction(self, "example_1", + layers=[example.arn], + function_name=function_name, + role=role + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_lambda_function_example.override_logical_id("example") +``` + +### Lambda Ephemeral Storage + +Lambda Function Ephemeral Storage(`/tmp`) allows you to configure the storage upto `10` GB. The default value set to `512` MB. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.iam_role import IamRole +from imports.aws.lambda_function import LambdaFunction +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + assume_role = DataAwsIamPolicyDocument(self, "assume_role", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["sts:AssumeRole"], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=["lambda.amazonaws.com"], + type="Service" + ) + ] + ) + ] + ) + iam_for_lambda = IamRole(self, "iam_for_lambda", + assume_role_policy=Token.as_string(assume_role.json), + name="iam_for_lambda" + ) + LambdaFunction(self, "test_lambda", + ephemeral_storage=LambdaFunctionEphemeralStorage( + size=10240 + ), + filename="lambda_function_payload.zip", + function_name="lambda_function_name", + handler="index.test", + role=iam_for_lambda.arn, + runtime="nodejs14.x" + ) +``` + +### Lambda File Systems + +Lambda File Systems allow you to connect an Amazon Elastic File System (EFS) file system to a Lambda function to share data across function invocations, access existing data including large files, and save function state. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.efs_access_point import EfsAccessPoint +from imports.aws.efs_file_system import EfsFileSystem +from imports.aws.efs_mount_target import EfsMountTarget +from imports.aws.lambda_function import LambdaFunction +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, functionName, role): + super().__init__(scope, name) + efs_for_lambda = EfsFileSystem(self, "efs_for_lambda", + tags={ + "Name": "efs_for_lambda" + } + ) + alpha = EfsMountTarget(self, "alpha", + file_system_id=efs_for_lambda.id, + security_groups=[sg_for_lambda.id], + subnet_id=subnet_for_lambda.id + ) + access_point_for_lambda = EfsAccessPoint(self, "access_point_for_lambda", + file_system_id=efs_for_lambda.id, + posix_user=EfsAccessPointPosixUser( + gid=1000, + uid=1000 + ), + root_directory=EfsAccessPointRootDirectory( + creation_info=EfsAccessPointRootDirectoryCreationInfo( + owner_gid=1000, + owner_uid=1000, + permissions="777" + ), + path="/lambda" + ) + ) + LambdaFunction(self, "example", + depends_on=[alpha], + file_system_config=LambdaFunctionFileSystemConfig( + arn=access_point_for_lambda.arn, + local_mount_path="/mnt/efs" + ), + vpc_config=LambdaFunctionVpcConfig( + security_group_ids=[sg_for_lambda.id], + subnet_ids=[subnet_for_lambda.id] + ), + function_name=function_name, + role=role + ) +``` + +### Lambda retries + +Lambda Functions allow you to configure error handling for asynchronous invocation. The settings that it supports are `Maximum age of event` and `Retry attempts` as stated in [Lambda documentation for Configuring error handling for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-errors). To configure these settings, refer to the [aws_lambda_function_event_invoke_config resource](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function_event_invoke_config). + +## CloudWatch Logging and Permissions + +For more information about CloudWatch Logs for Lambda, see the [Lambda User Guide](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-logs.html). + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformVariable, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.cloudwatch_log_group import CloudwatchLogGroup +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.iam_policy import IamPolicy +from imports.aws.iam_role_policy_attachment import IamRolePolicyAttachment +from imports.aws.lambda_function import LambdaFunction +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, role): + super().__init__(scope, name) + # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + # You can read more about this at https://cdk.tf/variables + lambda_function_name = TerraformVariable(self, "lambda_function_name", + default="lambda_function_name" + ) + example = CloudwatchLogGroup(self, "example", + name="/aws/lambda/${" + lambda_function_name.value + "}", + retention_in_days=14 + ) + lambda_logging = DataAwsIamPolicyDocument(self, "lambda_logging", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents" + ], + effect="Allow", + resources=["arn:aws:logs:*:*:*"] + ) + ] + ) + aws_iam_policy_lambda_logging = IamPolicy(self, "lambda_logging_3", + description="IAM policy for logging from a lambda", + name="lambda_logging", + path="/", + policy=Token.as_string(lambda_logging.json) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_iam_policy_lambda_logging.override_logical_id("lambda_logging") + lambda_logs = IamRolePolicyAttachment(self, "lambda_logs", + policy_arn=Token.as_string(aws_iam_policy_lambda_logging.arn), + role=iam_for_lambda.name + ) + LambdaFunction(self, "test_lambda", + depends_on=[lambda_logs, example], + function_name=lambda_function_name.string_value, + role=role + ) +``` + +## Specifying the Deployment Package + +AWS Lambda expects source code to be provided as a deployment package whose structure varies depending on which `runtime` is in use. See [Runtimes][6] for the valid values of `runtime`. The expected structure of the deployment package can be found in [the AWS Lambda documentation for each runtime][8]. + +Once you have created your deployment package you can specify it either directly as a local file (using the `filename` argument) or indirectly via Amazon S3 (using the `s3_bucket`, `s3_key` and `s3_object_version` arguments). When providing the deployment package via S3 it may be useful to use [the `aws_s3_object` resource](s3_object.html) to upload it. + +For larger deployment packages it is recommended by Amazon to upload via S3, since the S3 API has better support for uploading large files efficiently. + +## Argument Reference + +The following arguments are required: + +* `function_name` - (Required) Unique name for your Lambda Function. +* `role` - (Required) Amazon Resource Name (ARN) of the function's execution role. The role provides the function's identity and access to AWS services and resources. + +The following arguments are optional: + +* `architectures` - (Optional) Instruction set architecture for your Lambda function. Valid values are `["x86_64"]` and `["arm64"]`. Default is `["x86_64"]`. Removing this attribute, function's architecture stay the same. +* `code_signing_config_arn` - (Optional) To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function. +* `dead_letter_config` - (Optional) Configuration block. Detailed below. +* `description` - (Optional) Description of what your Lambda Function does. +* `environment` - (Optional) Configuration block. Detailed below. +* `ephemeral_storage` - (Optional) The amount of Ephemeral storage(`/tmp`) to allocate for the Lambda Function in MB. This parameter is used to expand the total amount of Ephemeral storage available, beyond the default amount of `512`MB. Detailed below. +* `file_system_config` - (Optional) Configuration block. Detailed below. +* `filename` - (Optional) Path to the function's deployment package within the local filesystem. Exactly one of `filename`, `image_uri`, or `s3_bucket` must be specified. +* `handler` - (Optional) Function [entrypoint][3] in your code. +* `image_config` - (Optional) Configuration block. Detailed below. +* `image_uri` - (Optional) ECR image URI containing the function's deployment package. Exactly one of `filename`, `image_uri`, or `s3_bucket` must be specified. +* `kms_key_arn` - (Optional) Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and Terraform will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration. +* `layers` - (Optional) List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See [Lambda Layers][10] +* `memory_size` - (Optional) Amount of memory in MB your Lambda Function can use at runtime. Defaults to `128`. See [Limits][5] +* `package_type` - (Optional) Lambda deployment package type. Valid values are `Zip` and `Image`. Defaults to `Zip`. +* `publish` - (Optional) Whether to publish creation/change as new Lambda Function Version. Defaults to `false`. +* `reserved_concurrent_executions` - (Optional) Amount of reserved concurrent executions for this lambda function. A value of `0` disables lambda from being triggered and `-1` removes any concurrency limitations. Defaults to Unreserved Concurrency Limits `-1`. See [Managing Concurrency][9] +* `replace_security_groups_on_destroy` - (Optional, **Deprecated**) **AWS no longer supports this operation. This attribute now has no effect and will be removed in a future major version.** Whether to replace the security groups on associated lambda network interfaces upon destruction. Removing these security groups from orphaned network interfaces can speed up security group deletion times by avoiding a dependency on AWS's internal cleanup operations. By default, the ENI security groups will be replaced with the `default` security group in the function's VPC. Set the `replacement_security_group_ids` attribute to use a custom list of security groups for replacement. +* `replacement_security_group_ids` - (Optional, **Deprecated**) List of security group IDs to assign to orphaned Lambda function network interfaces upon destruction. `replace_security_groups_on_destroy` must be set to `true` to use this attribute. +* `runtime` - (Optional) Identifier of the function's runtime. See [Runtimes][6] for valid values. +* `s3_bucket` - (Optional) S3 bucket location containing the function's deployment package. This bucket must reside in the same AWS region where you are creating the Lambda function. Exactly one of `filename`, `image_uri`, or `s3_bucket` must be specified. When `s3_bucket` is set, `s3_key` is required. +* `s3_key` - (Optional) S3 key of an object containing the function's deployment package. When `s3_bucket` is set, `s3_key` is required. +* `s3_object_version` - (Optional) Object version containing the function's deployment package. Conflicts with `filename` and `image_uri`. +* `skip_destroy` - (Optional) Set to true if you do not wish the function to be deleted at destroy time, and instead just remove the function from the Terraform state. +* `source_code_hash` - (Optional) Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either `filename` or `s3_key`. The usual way to set this is `filebase64sha256("file.zip")` (Terraform 0.11.12 and later) or `base64sha256(file("file.zip"))` (Terraform 0.11.11 and earlier), where "file.zip" is the local filename of the lambda function source archive. +* `snap_start` - (Optional) Snap start settings block. Detailed below. +* `tags` - (Optional) Map of tags to assign to the object. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `timeout` - (Optional) Amount of time your Lambda Function has to run in seconds. Defaults to `3`. See [Limits][5]. +* `tracing_config` - (Optional) Configuration block. Detailed below. +* `vpc_config` - (Optional) Configuration block. Detailed below. + +### dead_letter_config + +Dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq). + +* `target_arn` - (Required) ARN of an SNS topic or SQS queue to notify when an invocation fails. If this option is used, the function's IAM role must be granted suitable access to write to the target object, which means allowing either the `sns:Publish` or `sqs:SendMessage` action on this ARN, depending on which service is targeted. + +### environment + +* `variables` - (Optional) Map of environment variables that are accessible from the function code during execution. If provided at least one key must be present. + +### ephemeral_storage + +* `size` - (Required) The size of the Lambda function Ephemeral storage(`/tmp`) represented in MB. The minimum supported `ephemeral_storage` value defaults to `512`MB and the maximum supported value is `10240`MB. + +### file_system_config + +Connection settings for an EFS file system. Before creating or updating Lambda functions with `file_system_config`, EFS mount targets must be in available lifecycle state. Use `depends_on` to explicitly declare this dependency. See [Using Amazon EFS with Lambda][12]. + +* `arn` - (Required) Amazon Resource Name (ARN) of the Amazon EFS Access Point that provides access to the file system. +* `local_mount_path` - (Required) Path where the function can access the file system, starting with /mnt/. + +### image_config + +Container image configuration values that override the values in the container image Dockerfile. + +* `command` - (Optional) Parameters that you want to pass in with `entry_point`. +* `entry_point` - (Optional) Entry point to your application, which is typically the location of the runtime executable. +* `working_directory` - (Optional) Working directory. + +### snap_start + +Snap start settings for low-latency startups. This feature is currently only supported for `java11` runtimes. Remove this block to delete the associated settings (rather than setting `apply_on = "None"`). + +* `apply_on` - (Required) Conditions where snap start is enabled. Valid values are `PublishedVersions`. + +### tracing_config + +* `mode` - (Required) Whether to sample and trace a subset of incoming requests with AWS X-Ray. Valid values are `PassThrough` and `Active`. If `PassThrough`, Lambda will only trace the request from an upstream service if it contains a tracing header with "sampled=1". If `Active`, Lambda will respect any tracing header it receives from an upstream service. If no tracing header is received, Lambda will call X-Ray for a tracing decision. + +### vpc_config + +For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can only access resources and the internet through that VPC. See [VPC Settings][7]. + +~> **NOTE:** If both `subnet_ids` and `security_group_ids` are empty then `vpc_config` is considered to be empty or unset. + +* `security_group_ids` - (Required) List of security group IDs associated with the Lambda function. +* `subnet_ids` - (Required) List of subnet IDs associated with the Lambda function. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) identifying your Lambda Function. +* `invoke_arn` - ARN to be used for invoking Lambda Function from API Gateway - to be used in [`aws_api_gateway_integration`](/docs/providers/aws/r/api_gateway_integration.html)'s `uri`. +* `last_modified` - Date this resource was last modified. +* `qualified_arn` - ARN identifying your Lambda Function Version (if versioning is enabled via `publish = true`). +* `qualified_invoke_arn` - Qualified ARN (ARN with lambda version number) to be used for invoking Lambda Function from API Gateway - to be used in [`aws_api_gateway_integration`](/docs/providers/aws/r/api_gateway_integration.html)'s `uri`. +* `signing_job_arn` - ARN of the signing job. +* `signing_profile_version_arn` - ARN of the signing profile version. +* `snap_start.optimization_status` - Optimization status of the snap start configuration. Valid values are `On` and `Off`. +* `source_code_size` - Size in bytes of the function .zip file. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `version` - Latest published version of your Lambda Function. +* `vpc_config.vpc_id` - ID of the VPC. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/welcome.html +[3]: https://docs.aws.amazon.com/lambda/latest/dg/walkthrough-custom-events-create-test-function.html +[4]: https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html +[5]: https://docs.aws.amazon.com/lambda/latest/dg/limits.html +[6]: https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-Runtime +[7]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html +[8]: https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html +[9]: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html +[10]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html +[11]: https://learn.hashicorp.com/terraform/aws/lambda-api-gateway +[12]: https://docs.aws.amazon.com/lambda/latest/dg/services-efs.html + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `10m`) +* `update` - (Default `10m`) +* `delete` - (Default `10m`) + +## Import + +Lambda Functions can be imported using the `function_name`, e.g., + +``` +$ terraform import aws_lambda_function.test_lambda my_test_lambda_function +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_function_event_invoke_config.html.markdown b/website/docs/cdktf/python/r/lambda_function_event_invoke_config.html.markdown new file mode 100644 index 00000000000..527d75d6c9a --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_function_event_invoke_config.html.markdown @@ -0,0 +1,195 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function_event_invoke_config" +description: |- + Manages an asynchronous invocation configuration for a Lambda Function or Alias. +--- + + + +# Resource: aws_lambda_function_event_invoke_config + +Manages an asynchronous invocation configuration for a Lambda Function or Alias. More information about asynchronous invocations and the configurable values can be found in the [Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html). + +## Example Usage + +### Destination Configuration + +~> **NOTE:** Ensure the Lambda Function IAM Role has necessary permissions for the destination, such as `sqs:SendMessage` or `sns:Publish`, otherwise the API will return a generic `InvalidParameterValueException: The destination ARN arn:PARTITION:SERVICE:REGION:ACCOUNT:RESOURCE is invalid.` error. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_function_event_invoke_config import LambdaFunctionEventInvokeConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaFunctionEventInvokeConfig(self, "example", + destination_config=LambdaFunctionEventInvokeConfigDestinationConfig( + on_failure=LambdaFunctionEventInvokeConfigDestinationConfigOnFailure( + destination=Token.as_string(aws_sqs_queue_example.arn) + ), + on_success=LambdaFunctionEventInvokeConfigDestinationConfigOnSuccess( + destination=Token.as_string(aws_sns_topic_example.arn) + ) + ), + function_name=Token.as_string(aws_lambda_alias_example.function_name) + ) +``` + +### Error Handling Configuration + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_function_event_invoke_config import LambdaFunctionEventInvokeConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaFunctionEventInvokeConfig(self, "example", + function_name=Token.as_string(aws_lambda_alias_example.function_name), + maximum_event_age_in_seconds=60, + maximum_retry_attempts=0 + ) +``` + +### Configuration for Alias Name + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_function_event_invoke_config import LambdaFunctionEventInvokeConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaFunctionEventInvokeConfig(self, "example", + function_name=Token.as_string(aws_lambda_alias_example.function_name), + qualifier=Token.as_string(aws_lambda_alias_example.name) + ) +``` + +### Configuration for Function Latest Unpublished Version + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_function_event_invoke_config import LambdaFunctionEventInvokeConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaFunctionEventInvokeConfig(self, "example", + function_name=Token.as_string(aws_lambda_function_example.function_name), + qualifier="$LATEST" + ) +``` + +### Configuration for Function Published Version + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_function_event_invoke_config import LambdaFunctionEventInvokeConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaFunctionEventInvokeConfig(self, "example", + function_name=Token.as_string(aws_lambda_function_example.function_name), + qualifier=Token.as_string(aws_lambda_function_example.version) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `function_name` - (Required) Name or Amazon Resource Name (ARN) of the Lambda Function, omitting any version or alias qualifier. + +The following arguments are optional: + +* `destination_config` - (Optional) Configuration block with destination configuration. See below for details. +* `maximum_event_age_in_seconds` - (Optional) Maximum age of a request that Lambda sends to a function for processing in seconds. Valid values between 60 and 21600. +* `maximum_retry_attempts` - (Optional) Maximum number of times to retry when the function returns an error. Valid values between 0 and 2. Defaults to 2. +* `qualifier` - (Optional) Lambda Function published version, `$LATEST`, or Lambda Alias name. + +### destination_config Configuration Block + +~> **NOTE:** At least one of `on_failure` or `on_success` must be configured when using this configuration block, otherwise remove it completely to prevent perpetual differences in Terraform runs. + +The following arguments are optional: + +* `on_failure` - (Optional) Configuration block with destination configuration for failed asynchronous invocations. See below for details. +* `on_success` - (Optional) Configuration block with destination configuration for successful asynchronous invocations. See below for details. + +#### destination_config on_failure Configuration Block + +The following arguments are required: + +* `destination` - (Required) Amazon Resource Name (ARN) of the destination resource. See the [Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations) for acceptable resource types and associated IAM permissions. + +#### destination_config on_success Configuration Block + +The following arguments are required: + +* `destination` - (Required) Amazon Resource Name (ARN) of the destination resource. See the [Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations) for acceptable resource types and associated IAM permissions. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - Fully qualified Lambda Function name or Amazon Resource Name (ARN) + +## Import + +Lambda Function Event Invoke Configs can be imported using the fully qualified Function name or Amazon Resource Name (ARN), e.g., + +ARN without qualifier (all versions and aliases): + +``` +$ terraform import aws_lambda_function_event_invoke_config.example arn:aws:us-east-1:123456789012:function:my_function +``` + +ARN with qualifier: + +``` +$ terraform import aws_lambda_function_event_invoke_config.example arn:aws:us-east-1:123456789012:function:my_function:production +``` + +Name without qualifier (all versions and aliases): + +``` +$ terraform import aws_lambda_function_event_invoke_config.example my_function +``` + +Name with qualifier: + +``` +$ terraform import aws_lambda_function_event_invoke_config.example my_function:production +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_function_url.html.markdown b/website/docs/cdktf/python/r/lambda_function_url.html.markdown new file mode 100644 index 00000000000..734994a0dd2 --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_function_url.html.markdown @@ -0,0 +1,85 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function_url" +description: |- + Provides a Lambda function URL resource. +--- + + + +# Resource: aws_lambda_function_url + +Provides a Lambda function URL resource. A function URL is a dedicated HTTP(S) endpoint for a Lambda function. + +See the [AWS Lambda documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) for more information. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_function_url import LambdaFunctionUrl +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaFunctionUrl(self, "test_latest", + authorization_type="NONE", + function_name=test.function_name + ) + LambdaFunctionUrl(self, "test_live", + authorization_type="AWS_IAM", + cors=LambdaFunctionUrlCors( + allow_credentials=True, + allow_headers=["date", "keep-alive"], + allow_methods=["*"], + allow_origins=["*"], + expose_headers=["keep-alive", "date"], + max_age=86400 + ), + function_name=test.function_name, + qualifier="my_alias" + ) +``` + +## Argument Reference + +* `authorization_type` - (Required) The type of authentication that the function URL uses. Set to `"AWS_IAM"` to restrict access to authenticated IAM users only. Set to `"NONE"` to bypass IAM authentication and create a public endpoint. See the [AWS documentation](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html) for more details. +* `cors` - (Optional) The [cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for the function URL. Documented below. +* `function_name` - (Required) The name (or ARN) of the Lambda function. +* `invoke_mode` - (Optional) Determines how the Lambda function responds to an invocation. Valid values are `BUFFERED` (default) and `RESPONSE_STREAM`. See more in [Configuring a Lambda function to stream responses](https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html). +* `qualifier` - (Optional) The alias name or `"$LATEST"`. + +### cors + +This configuration block supports the following attributes: + +* `allow_credentials` - (Optional) Whether to allow cookies or other credentials in requests to the function URL. The default is `false`. +* `allow_headers` - (Optional) The HTTP headers that origins can include in requests to the function URL. For example: `["date", "keep-alive", "x-custom-header"]`. +* `allow_methods` - (Optional) The HTTP methods that are allowed when calling the function URL. For example: `["GET", "POST", "DELETE"]`, or the wildcard character (`["*"]`). +* `allow_origins` - (Optional) The origins that can access the function URL. You can list any number of specific origins (or the wildcard character (`"*"`)), separated by a comma. For example: `["https://www.example.com", "http://localhost:60905"]`. +* `expose_headers` - (Optional) The HTTP headers in your function response that you want to expose to origins that call the function URL. +* `max_age` - (Optional) The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to `0`, which means that the browser doesn't cache results. The maximum value is `86400`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `function_arn` - The Amazon Resource Name (ARN) of the function. +* `function_url` - The HTTP URL endpoint for the function in the format `https://.lambda-url..on.aws`. +* `url_id` - A generated ID for the endpoint. + +## Import + +Lambda function URLs can be imported using the `function_name` or `function_name/qualifier`, e.g., + +``` +$ terraform import aws_lambda_function_url.test_lambda_url my_test_lambda_function +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_invocation.html.markdown b/website/docs/cdktf/python/r/lambda_invocation.html.markdown new file mode 100644 index 00000000000..c5d636d628e --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_invocation.html.markdown @@ -0,0 +1,175 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_invocation" +description: |- + Invoke AWS Lambda Function +--- + + + +# Resource: aws_lambda_invocation + +Use this resource to invoke a lambda function. The lambda function is invoked with the [RequestResponse](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) invocation type. + +~> **NOTE:** By default this resource _only_ invokes the function when the arguments call for a create or replace. In other words, after an initial invocation on _apply_, if the arguments do not change, a subsequent _apply_ does not invoke the function again. To dynamically invoke the function, see the `triggers` example below. To always invoke a function on each _apply_, see the [`aws_lambda_invocation`](/docs/providers/aws/d/lambda_invocation.html) data source. To invoke the lambda function when the terraform resource is updated and deleted, see the [CRUD Lifecycle Scope](#crud-lifecycle-scope) example below. + +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + +## Example Usage + +### Basic Example + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformOutput, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_invocation import LambdaInvocation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = LambdaInvocation(self, "example", + function_name=lambda_function_test.function_name, + input=Token.as_string( + Fn.jsonencode({ + "key1": "value1", + "key2": "value2" + })) + ) + TerraformOutput(self, "result_entry", + value=property_access(Fn.jsondecode(example.result), ["\"key1\""]) + ) +``` + +### Dynamic Invocation Example Using Triggers + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_invocation import LambdaInvocation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaInvocation(self, "example", + function_name=lambda_function_test.function_name, + input=Token.as_string( + Fn.jsonencode({ + "key1": "value1", + "key2": "value2" + })), + triggers={ + "redeployment": Token.as_string( + Fn.sha1( + Token.as_string( + Fn.jsonencode([aws_lambda_function_example.environment])))) + } + ) +``` + +### CRUD Lifecycle Scope + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_invocation import LambdaInvocation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaInvocation(self, "example", + function_name=lambda_function_test.function_name, + input=Token.as_string( + Fn.jsonencode({ + "key1": "value1", + "key2": "value2" + })), + lifecycle_scope="CRUD" + ) +``` + +~> **NOTE:** `lifecycle_scope = "CRUD"` will inject a key `tf` in the input event to pass lifecycle information! This allows the lambda function to handle different lifecycle transitions uniquely. If you need to use a key `tf` in your own input JSON, the default key name can be overridden with the `terraform_key` argument. + +The key `tf` gets added with subkeys: + +* `action` - Action Terraform performs on the resource. Values are `create`, `update`, or `delete`. +* `prev_input` - Input JSON payload from the previous invocation. This can be used to handle update and delete events. + +When the resource from the example above is created, the Lambda will get following JSON payload: + +```json +{ + "key1": "value1", + "key2": "value2", + "tf": { + "action": "create", + "prev_input": null + } +} +``` + +If the input value of `key1` changes to "valueB", then the lambda will be invoked again with the following JSON payload: + +```json +{ + "key1": "valueB", + "key2": "value2", + "tf": { + "action": "update", + "prev_input": { + "key1": "value1", + "key2": "value2" + } + } +} +``` + +When the invocation resource is removed, the final invocation will have the following JSON payload: + +```json +{ + "key1": "valueB", + "key2": "value2", + "tf": { + "action": "delete", + "prev_input": { + "key1": "valueB", + "key2": "value2" + } + } +} +``` + +## Argument Reference + +The following arguments are required: + +* `function_name` - (Required) Name of the lambda function. +* `input` - (Required) JSON payload to the lambda function. + +The following arguments are optional: + +* `lifecycle_scope` - (Optional) Lifecycle scope of the resource to manage. Valid values are `CREATE_ONLY` and `CRUD`. Defaults to `CREATE_ONLY`. `CREATE_ONLY` will invoke the function only on creation or replacement. `CRUD` will invoke the function on each lifecycle event, and augment the input JSON payload with additional lifecycle information. +* `qualifier` - (Optional) Qualifier (i.e., version) of the lambda function. Defaults to `$LATEST`. +* `terraform_key` - (Optional) The JSON key used to store lifecycle information in the input JSON payload. Defaults to `tf`. This additional key is only included when `lifecycle_scope` is set to `CRUD`. +* `triggers` - (Optional) Map of arbitrary keys and values that, when changed, will trigger a re-invocation. To force a re-invocation without changing these keys/values, use the [`terraform taint` command](https://www.terraform.io/docs/commands/taint.html). + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `result` - String result of the lambda function invocation. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_layer_version.html.markdown b/website/docs/cdktf/python/r/lambda_layer_version.html.markdown new file mode 100644 index 00000000000..762c469f55b --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_layer_version.html.markdown @@ -0,0 +1,97 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_layer_version" +description: |- + Provides a Lambda Layer Version resource. Lambda Layers allow you to reuse shared bits of code across multiple lambda functions. +--- + + + +# Resource: aws_lambda_layer_version + +Provides a Lambda Layer Version resource. Lambda Layers allow you to reuse shared bits of code across multiple lambda functions. + +For information about Lambda Layers and how to use them, see [AWS Lambda Layers][1]. + +~> **NOTE:** Setting `skip_destroy` to `true` means that the AWS Provider will _not_ destroy any layer version, even when running `terraform destroy`. Layer versions are thus intentional dangling resources that are _not_ managed by Terraform and may incur extra expense in your AWS account. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_layer_version import LambdaLayerVersion +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaLayerVersion(self, "lambda_layer", + compatible_runtimes=["nodejs16.x"], + filename="lambda_layer_payload.zip", + layer_name="lambda_layer_name" + ) +``` + +## Specifying the Deployment Package + +AWS Lambda Layers expect source code to be provided as a deployment package whose structure varies depending on which `compatible_runtimes` this layer specifies. +See [Runtimes][2] for the valid values of `compatible_runtimes`. + +Once you have created your deployment package you can specify it either directly as a local file (using the `filename` argument) or +indirectly via Amazon S3 (using the `s3_bucket`, `s3_key` and `s3_object_version` arguments). When providing the deployment +package via S3 it may be useful to use [the `aws_s3_object` resource](s3_object.html) to upload it. + +For larger deployment packages it is recommended by Amazon to upload via S3, since the S3 API has better support for uploading large files efficiently. + +## Argument Reference + +The following arguments are required: + +* `layer_name` - (Required) Unique name for your Lambda Layer + +The following arguments are optional: + +* `compatible_architectures` - (Optional) List of [Architectures][4] this layer is compatible with. Currently `x86_64` and `arm64` can be specified. +* `compatible_runtimes` - (Optional) List of [Runtimes][2] this layer is compatible with. Up to 5 runtimes can be specified. +* `description` - (Optional) Description of what your Lambda Layer does. +* `filename` (Optional) Path to the function's deployment package within the local filesystem. If defined, The `s3_`-prefixed options cannot be used. +* `license_info` - (Optional) License info for your Lambda Layer. See [License Info][3]. +* `s3_bucket` - (Optional) S3 bucket location containing the function's deployment package. Conflicts with `filename`. This bucket must reside in the same AWS region where you are creating the Lambda function. +* `s3_key` - (Optional) S3 key of an object containing the function's deployment package. Conflicts with `filename`. +* `s3_object_version` - (Optional) Object version containing the function's deployment package. Conflicts with `filename`. +* `skip_destroy` - (Optional) Whether to retain the old version of a previously deployed Lambda Layer. Default is `false`. When this is not set to `true`, changing any of `compatible_architectures`, `compatible_runtimes`, `description`, `filename`, `layer_name`, `license_info`, `s3_bucket`, `s3_key`, `s3_object_version`, or `source_code_hash` forces deletion of the existing layer version and creation of a new layer version. +* `source_code_hash` - (Optional) Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either `filename` or `s3_key`. The usual way to set this is `${filebase64sha256("file.zip")}` (Terraform 0.11.12 or later) or `${base64sha256(file("file.zip"))}` (Terraform 0.11.11 and earlier), where "file.zip" is the local filename of the lambda layer source archive. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the Lambda Layer with version. +* `created_date` - Date this resource was created. +* `layer_arn` - ARN of the Lambda Layer without version. +* `signing_job_arn` - ARN of a signing job. +* `signing_profile_version_arn` - ARN for a signing profile version. +* `source_code_size` - Size in bytes of the function .zip file. +* `version` - Lambda Layer version. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html +[2]: https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-CompatibleRuntimes +[3]: https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-LicenseInfo +[4]: https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-CompatibleArchitectures + +## Import + +Lambda Layers can be imported using `arn`. + +``` +$ terraform import \ + aws_lambda_layer_version.test_layer \ + arn:aws:lambda:_REGION_:_ACCOUNT_ID_:layer:_LAYER_NAME_:_LAYER_VERSION_ +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_layer_version_permission.html.markdown b/website/docs/cdktf/python/r/lambda_layer_version_permission.html.markdown new file mode 100644 index 00000000000..a8c4fc1043d --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_layer_version_permission.html.markdown @@ -0,0 +1,72 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_layer_version_permission" +description: |- + Provides a Lambda Layer Version Permission resource. +--- + + + +# Resource: aws_lambda_layer_version_permission + +Provides a Lambda Layer Version Permission resource. It allows you to share you own Lambda Layers to another account by account ID, to all accounts in AWS organization or even to all AWS accounts. + +For information about Lambda Layer Permissions and how to use them, see [Using Resource-based Policies for AWS Lambda][1] + +~> **NOTE:** Setting `skip_destroy` to `true` means that the AWS Provider will _not_ destroy any layer version permission, even when running `terraform destroy`. Layer version permissions are thus intentional dangling resources that are _not_ managed by Terraform and may incur extra expense in your AWS account. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_layer_version_permission import LambdaLayerVersionPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaLayerVersionPermission(self, "lambda_layer_permission", + action="lambda:GetLayerVersion", + layer_name="arn:aws:lambda:us-west-2:123456654321:layer:test_layer1", + principal="111111111111", + statement_id="dev-account", + version_number=1 + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `action` - (Required) Action, which will be allowed. `lambda:GetLayerVersion` value is suggested by AWS documantation. +* `layer_name` (Required) The name or ARN of the Lambda Layer, which you want to grant access to. +* `organization_id` - (Optional) An identifier of AWS Organization, which should be able to use your Lambda Layer. `principal` should be equal to `*` if `organization_id` provided. +* `principal` - (Required) AWS account ID which should be able to use your Lambda Layer. `*` can be used here, if you want to share your Lambda Layer widely. +* `statement_id` - (Required) The name of Lambda Layer Permission, for example `dev-account` - human readable note about what is this permission for. +* `version_number` (Required) Version of Lambda Layer, which you want to grant access to. Note: permissions only apply to a single version of a layer. +* `skip_destroy` - (Optional) Whether to retain the old version of a previously deployed Lambda Layer. Default is `false`. When this is not set to `true`, changing any of `compatible_architectures`, `compatible_runtimes`, `description`, `filename`, `layer_name`, `license_info`, `s3_bucket`, `s3_key`, `s3_object_version`, or `source_code_hash` forces deletion of the existing layer version and creation of a new layer version. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The `layer_name` and `version_number`, separated by a comma (`,`). +* `revision_id` - A unique identifier for the current revision of the policy. +* `policy` - Full Lambda Layer Permission policy. + +## Import + +Lambda Layer Permissions can be imported using `layer_name` and `version_number`, separated by a comma (`,`). + +```sh +$ terraform import aws_lambda_layer_version_permission.example arn:aws:lambda:us-west-2:123456654321:layer:test_layer1,1 +``` + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html#permissions-resource-xaccountlayer + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_permission.html.markdown b/website/docs/cdktf/python/r/lambda_permission.html.markdown new file mode 100644 index 00000000000..7c46cb9599b --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_permission.html.markdown @@ -0,0 +1,322 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_permission" +description: |- + Creates a Lambda function permission. +--- + + + +# Resource: aws_lambda_permission + +Gives an external source (like an EventBridge Rule, SNS, or S3) permission to access the Lambda function. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.iam_role import IamRole +from imports.aws.lambda_alias import LambdaAlias +from imports.aws.lambda_function import LambdaFunction +from imports.aws.lambda_permission import LambdaPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + iam_for_lambda = IamRole(self, "iam_for_lambda", + assume_role_policy=Token.as_string( + Fn.jsonencode({ + "Statement": [{ + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Sid": "" + } + ], + "Version": "2012-10-17" + })), + name="iam_for_lambda" + ) + test_lambda = LambdaFunction(self, "test_lambda", + filename="lambdatest.zip", + function_name="lambda_function_name", + handler="exports.handler", + role=iam_for_lambda.arn, + runtime="nodejs16.x" + ) + test_alias = LambdaAlias(self, "test_alias", + description="a sample description", + function_name=test_lambda.function_name, + function_version="$LATEST", + name="testalias" + ) + LambdaPermission(self, "allow_cloudwatch", + action="lambda:InvokeFunction", + function_name=test_lambda.function_name, + principal="events.amazonaws.com", + qualifier=test_alias.name, + source_arn="arn:aws:events:eu-west-1:111122223333:rule/RunDaily", + statement_id="AllowExecutionFromCloudWatch" + ) +``` + +### With SNS + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.iam_role import IamRole +from imports.aws.lambda_function import LambdaFunction +from imports.aws.lambda_permission import LambdaPermission +from imports.aws.sns_topic import SnsTopic +from imports.aws.sns_topic_subscription import SnsTopicSubscription +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + default_var = IamRole(self, "default", + assume_role_policy=Token.as_string( + Fn.jsonencode({ + "Statement": [{ + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Sid": "" + } + ], + "Version": "2012-10-17" + })), + name="iam_for_lambda_with_sns" + ) + func = LambdaFunction(self, "func", + filename="lambdatest.zip", + function_name="lambda_called_from_sns", + handler="exports.handler", + role=default_var.arn, + runtime="python3.7" + ) + aws_sns_topic_default = SnsTopic(self, "default_2", + name="call-lambda-maybe" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_sns_topic_default.override_logical_id("default") + SnsTopicSubscription(self, "lambda", + endpoint=func.arn, + protocol="lambda", + topic_arn=Token.as_string(aws_sns_topic_default.arn) + ) + LambdaPermission(self, "with_sns", + action="lambda:InvokeFunction", + function_name=func.function_name, + principal="sns.amazonaws.com", + source_arn=Token.as_string(aws_sns_topic_default.arn), + statement_id="AllowExecutionFromSNS" + ) +``` + +### With API Gateway REST API + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.api_gateway_rest_api import ApiGatewayRestApi +from imports.aws.lambda_permission import LambdaPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + my_demo_api = ApiGatewayRestApi(self, "MyDemoAPI", + description="This is my API for demonstration purposes", + name="MyDemoAPI" + ) + LambdaPermission(self, "lambda_permission", + action="lambda:InvokeFunction", + function_name="MyDemoFunction", + principal="apigateway.amazonaws.com", + source_arn="${" + my_demo_api.execution_arn + "}/*", + statement_id="AllowMyDemoAPIInvoke" + ) +``` + +### With CloudWatch Log Group + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.cloudwatch_log_group import CloudwatchLogGroup +from imports.aws.cloudwatch_log_subscription_filter import CloudwatchLogSubscriptionFilter +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.iam_role import IamRole +from imports.aws.lambda_function import LambdaFunction +from imports.aws.lambda_permission import LambdaPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + default_var = CloudwatchLogGroup(self, "default", + name="/default" + ) + assume_role = DataAwsIamPolicyDocument(self, "assume_role", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["sts:AssumeRole"], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=["lambda.amazonaws.com"], + type="Service" + ) + ] + ) + ] + ) + aws_iam_role_default = IamRole(self, "default_2", + assume_role_policy=Token.as_string(assume_role.json), + name="iam_for_lambda_called_from_cloudwatch_logs" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_iam_role_default.override_logical_id("default") + logging = LambdaFunction(self, "logging", + filename="lamba_logging.zip", + function_name="lambda_called_from_cloudwatch_logs", + handler="exports.handler", + role=Token.as_string(aws_iam_role_default.arn), + runtime="python3.7" + ) + aws_lambda_permission_logging = LambdaPermission(self, "logging_4", + action="lambda:InvokeFunction", + function_name=logging.function_name, + principal="logs.eu-west-1.amazonaws.com", + source_arn="${" + default_var.arn + "}:*" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_lambda_permission_logging.override_logical_id("logging") + aws_cloudwatch_log_subscription_filter_logging = + CloudwatchLogSubscriptionFilter(self, "logging_5", + depends_on=[aws_lambda_permission_logging], + destination_arn=logging.arn, + filter_pattern="", + log_group_name=default_var.name, + name="logging_default" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_cloudwatch_log_subscription_filter_logging.override_logical_id("logging") +``` + +### With Cross-Account Invocation Policy + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_function_url import LambdaFunctionUrl +from imports.aws.lambda_permission import LambdaPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaFunctionUrl(self, "url", + authorization_type="AWS_IAM", + function_name=example.function_name + ) + aws_lambda_permission_url = LambdaPermission(self, "url_1", + action="lambda:InvokeFunctionUrl", + function_name=example.function_name, + function_url_auth_type="AWS_IAM", + principal="arn:aws:iam::444455556666:role/example", + source_account="444455556666" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_lambda_permission_url.override_logical_id("url") +``` + +### With `replace_triggered_by` Lifecycle Configuration + +If omitting the `qualifier` argument (which forces re-creation each time a function version is published), a `lifecycle` block can be used to ensure permissions are re-applied on any change to the underlying function. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from cdktf import TerraformResourceLifecycle +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_permission import LambdaPermission +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaPermission(self, "logging", + action="lambda:InvokeFunction", + function_name=example.function_name, + lifecycle=TerraformResourceLifecycle( + replace_triggered_by=[example] + ), + principal="events.amazonaws.com", + source_arn="arn:aws:events:eu-west-1:111122223333:rule/RunDaily" + ) +``` + +## Argument Reference + +* `action` - (Required) The AWS Lambda action you want to allow in this statement. (e.g., `lambda:InvokeFunction`) +* `event_source_token` - (Optional) The Event Source Token to validate. Used with [Alexa Skills][1]. +* `function_name` - (Required) Name of the Lambda function whose resource policy you are updating +* `function_url_auth_type` - (Optional) Lambda Function URLs [authentication type][3]. Valid values are: `AWS_IAM` or `NONE`. Only supported for `lambda:InvokeFunctionUrl` action. +* `principal` - (Required) The principal who is getting this permission e.g., `s3.amazonaws.com`, an AWS account ID, or AWS IAM principal, or AWS service principal such as `events.amazonaws.com` or `sns.amazonaws.com`. +* `qualifier` - (Optional) Query parameter to specify function version or alias name. The permission will then apply to the specific qualified ARN e.g., `arn:aws:lambda:aws-region:acct-id:function:function-name:2` +* `source_account` - (Optional) This parameter is used when allowing cross-account access, or for S3 and SES. The AWS account ID (without a hyphen) of the source owner. +* `source_arn` - (Optional) When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to. + Without this, any resource from `principal` will be granted permission – even if that resource is from another account. + For S3, this should be the ARN of the S3 Bucket. + For EventBridge events, this should be the ARN of the EventBridge Rule. + For API Gateway, this should be the ARN of the API, as described [here][2]. +* `statement_id` - (Optional) A unique statement identifier. By default generated by Terraform. +* `statement_id_prefix` - (Optional) A statement identifier prefix. Terraform will generate a unique suffix. Conflicts with `statement_id`. +* `principal_org_id` - (Optional) The identifier for your organization in AWS Organizations. Use this to grant permissions to all the AWS accounts under this organization. + +[1]: https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html#use-aws-cli +[2]: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-control-access-using-iam-policies-to-invoke-api.html +[3]: https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html + +## Attributes Reference + +No additional attributes are exported. + +## Import + +Lambda permission statements can be imported using function_name/statement_id, with an optional qualifier, e.g., + +``` +$ terraform import aws_lambda_permission.test_lambda_permission my_test_lambda_function/AllowExecutionFromCloudWatch + +$ terraform import aws_lambda_permission.test_lambda_permission my_test_lambda_function:qualifier_name/AllowExecutionFromCloudWatch +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/lambda_provisioned_concurrency_config.html.markdown b/website/docs/cdktf/python/r/lambda_provisioned_concurrency_config.html.markdown new file mode 100644 index 00000000000..71048841fa3 --- /dev/null +++ b/website/docs/cdktf/python/r/lambda_provisioned_concurrency_config.html.markdown @@ -0,0 +1,94 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_provisioned_concurrency_config" +description: |- + Manages a Lambda Provisioned Concurrency Configuration +--- + + + +# Resource: aws_lambda_provisioned_concurrency_config + +Manages a Lambda Provisioned Concurrency Configuration. + +~> **NOTE:** Setting `skip_destroy` to `true` means that the AWS Provider will _not_ destroy a provisioned concurrency configuration, even when running `terraform destroy`. The configuration is thus an intentional dangling resource that is _not_ managed by Terraform and may incur extra expense in your AWS account. + +## Example Usage + +### Alias Name + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_provisioned_concurrency_config import LambdaProvisionedConcurrencyConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaProvisionedConcurrencyConfig(self, "example", + function_name=Token.as_string(aws_lambda_alias_example.function_name), + provisioned_concurrent_executions=1, + qualifier=Token.as_string(aws_lambda_alias_example.name) + ) +``` + +### Function Version + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.lambda_provisioned_concurrency_config import LambdaProvisionedConcurrencyConfig +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + LambdaProvisionedConcurrencyConfig(self, "example", + function_name=Token.as_string(aws_lambda_function_example.function_name), + provisioned_concurrent_executions=1, + qualifier=Token.as_string(aws_lambda_function_example.version) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `function_name` - (Required) Name or Amazon Resource Name (ARN) of the Lambda Function. +* `provisioned_concurrent_executions` - (Required) Amount of capacity to allocate. Must be greater than or equal to `1`. +* `qualifier` - (Required) Lambda Function version or Lambda Alias name. + +The following arguments are optional: + +* `skip_destroy` - (Optional) Whether to retain the provisoned concurrency configuration upon destruction. Defaults to `false`. If set to `true`, the resource in simply removed from state instead. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - Lambda Function name and qualifier separated by a comma (`,`). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `15m`) +* `update` - (Default `15m`) + +## Import + +A Lambda Provisioned Concurrency Configuration can be imported using the `function_name` and `qualifier` separated by a comma (`,`), e.g., + +``` +$ terraform import aws_lambda_provisioned_concurrency_config.example my_function,production +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc.html.markdown b/website/docs/cdktf/python/r/vpc.html.markdown new file mode 100644 index 00000000000..9f47e71608d --- /dev/null +++ b/website/docs/cdktf/python/r/vpc.html.markdown @@ -0,0 +1,153 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc" +description: |- + Provides a VPC resource. +--- + + + +# Resource: aws_vpc + +Provides a VPC resource. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc import Vpc +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Vpc(self, "main", + cidr_block="10.0.0.0/16" + ) +``` + +Basic usage with tags: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc import Vpc +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + Vpc(self, "main", + cidr_block="10.0.0.0/16", + instance_tenancy="default", + tags={ + "Name": "main" + } + ) +``` + +VPC with CIDR from AWS IPAM: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc import Vpc +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_pool import VpcIpamPool +from imports.aws.vpc_ipam_pool_cidr import VpcIpamPoolCidr +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + test = VpcIpam(self, "test", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + aws_vpc_ipam_pool_test = VpcIpamPool(self, "test_2", + address_family="ipv4", + ipam_scope_id=test.private_default_scope_id, + locale=Token.as_string(current.name) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_test.override_logical_id("test") + aws_vpc_ipam_pool_cidr_test = VpcIpamPoolCidr(self, "test_3", + cidr="172.2.0.0/16", + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_test.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_test.override_logical_id("test") + aws_vpc_test = Vpc(self, "test_4", + depends_on=[aws_vpc_ipam_pool_cidr_test], + ipv4_ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_test.id), + ipv4_netmask_length=28 + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_test.override_logical_id("test") +``` + +## Argument Reference + +The following arguments are supported: + +* `cidr_block` - (Optional) The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv4_netmask_length`. +* `instance_tenancy` - (Optional) A tenancy option for instances launched into the VPC. Default is `default`, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is `dedicated`, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee. +* `ipv4_ipam_pool_id` - (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization. +* `ipv4_netmask_length` - (Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a `ipv4_ipam_pool_id`. +* `ipv6_cidr_block` - (Optional) IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using `ipv6_netmask_length`. +* `ipv6_ipam_pool_id` - (Optional) IPAM Pool ID for a IPv6 pool. Conflicts with `assign_generated_ipv6_cidr_block`. +* `ipv6_netmask_length` - (Optional) Netmask length to request from IPAM Pool. Conflicts with `ipv6_cidr_block`. This can be omitted if IPAM pool as a `allocation_default_netmask_length` set. Valid values: `56`. +* `ipv6_cidr_block_network_border_group` - (Optional) By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones. +* `enable_dns_support` - (Optional) A boolean flag to enable/disable DNS support in the VPC. Defaults to true. +* `enable_network_address_usage_metrics` - (Optional) Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false. +* `enable_dns_hostnames` - (Optional) A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false. +* `assign_generated_ipv6_cidr_block` - (Optional) Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is `false`. Conflicts with `ipv6_ipam_pool_id` +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of VPC +* `id` - The ID of the VPC +* `instance_tenancy` - Tenancy of instances spin up within VPC +* `enable_dns_support` - Whether or not the VPC has DNS support +* `enable_network_address_usage_metrics` - Whether Network Address Usage metrics are enabled for the VPC +* `enable_dns_hostnames` - Whether or not the VPC has DNS hostname support +* `main_route_table_id` - The ID of the main route table associated with + this VPC. Note that you can change a VPC's main route table by using an + [`aws_main_route_table_association`](/docs/providers/aws/r/main_route_table_association.html). +* `default_network_acl_id` - The ID of the network ACL created by default on VPC creation +* `default_security_group_id` - The ID of the security group created by default on VPC creation +* `default_route_table_id` - The ID of the route table created by default on VPC creation +* `ipv6_association_id` - The association ID for the IPv6 CIDR block. +* `ipv6_cidr_block_network_border_group` - The Network Border Group Zone name +* `owner_id` - The ID of the AWS account that owns the VPC. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +VPCs can be imported using the `vpc id`, e.g., + +``` +$ terraform import aws_vpc.test_vpc vpc-a01106c2 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_dhcp_options.html.markdown b/website/docs/cdktf/python/r/vpc_dhcp_options.html.markdown new file mode 100644 index 00000000000..5ed06604909 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_dhcp_options.html.markdown @@ -0,0 +1,101 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_dhcp_options" +description: |- + Provides a VPC DHCP Options resource. +--- + + + +# Resource: aws_vpc_dhcp_options + +Provides a VPC DHCP Options resource. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_dhcp_options import VpcDhcpOptions +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcDhcpOptions(self, "dns_resolver", + domain_name_servers=["8.8.8.8", "8.8.4.4"] + ) +``` + +Full usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_dhcp_options import VpcDhcpOptions +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcDhcpOptions(self, "foo", + domain_name="service.consul", + domain_name_servers=["127.0.0.1", "10.0.0.2"], + netbios_name_servers=["127.0.0.1"], + netbios_node_type=Token.as_string(2), + ntp_servers=["127.0.0.1"], + tags={ + "Name": "foo-name" + } + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `domain_name` - (Optional) the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the `search` value in the `/etc/resolv.conf` file. +* `domain_name_servers` - (Optional) List of name servers to configure in `/etc/resolv.conf`. If you want to use the default AWS nameservers you should set this to `AmazonProvidedDNS`. +* `ntp_servers` - (Optional) List of NTP servers to configure. +* `netbios_name_servers` - (Optional) List of NETBIOS name servers. +* `netbios_node_type` - (Optional) The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see [RFC 2132](http://www.ietf.org/rfc/rfc2132.txt). +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Remarks + +* Notice that all arguments are optional but you have to specify at least one argument. +* `domain_name_servers`, `netbios_name_servers`, `ntp_servers` are limited by AWS to maximum four servers only. +* To actually use the DHCP Options Set you need to associate it to a VPC using [`aws_vpc_dhcp_options_association`](/docs/providers/aws/r/vpc_dhcp_options_association.html). +* If you delete a DHCP Options Set, all VPCs using it will be associated to AWS's `default` DHCP Option Set. +* In most cases unless you're configuring your own DNS you'll want to set `domain_name_servers` to `AmazonProvidedDNS`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the DHCP Options Set. +* `arn` - The ARN of the DHCP Options Set. +* `owner_id` - The ID of the AWS account that owns the DHCP options set. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +You can find more technical documentation about DHCP Options Set in the +official [AWS User Guide](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html). + +## Import + +VPC DHCP Options can be imported using the `dhcp options id`, e.g., + +``` +$ terraform import aws_vpc_dhcp_options.my_options dopt-d9070ebb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_dhcp_options_association.html.markdown b/website/docs/cdktf/python/r/vpc_dhcp_options_association.html.markdown new file mode 100644 index 00000000000..657e4b9825f --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_dhcp_options_association.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_dhcp_options_association" +description: |- + Provides a VPC DHCP Options Association resource. +--- + + + +# Resource: aws_vpc_dhcp_options_association + +Provides a VPC DHCP Options Association resource. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_dhcp_options_association import VpcDhcpOptionsAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcDhcpOptionsAssociation(self, "dns_resolver", + dhcp_options_id=foo.id, + vpc_id=Token.as_string(aws_vpc_foo.id) + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `vpc_id` - (Required) The ID of the VPC to which we would like to associate a DHCP Options Set. +* `dhcp_options_id` - (Required) The ID of the DHCP Options Set to associate to the VPC. + +## Remarks + +* You can only associate one DHCP Options Set to a given VPC ID. +* Removing the DHCP Options Association automatically sets AWS's `default` DHCP Options Set to the VPC. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the DHCP Options Set Association. + +## Import + +DHCP associations can be imported by providing the VPC ID associated with the options: + +``` +$ terraform import aws_vpc_dhcp_options_association.imported vpc-0f001273ec18911b1 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint.html.markdown new file mode 100644 index 00000000000..609006b08da --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint.html.markdown @@ -0,0 +1,228 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint" +description: |- + Provides a VPC Endpoint resource. +--- + + + +# Resource: aws_vpc_endpoint + +Provides a VPC Endpoint resource. + +~> **NOTE on VPC Endpoints and VPC Endpoint Associations:** Terraform provides both standalone VPC Endpoint Associations for +[Route Tables](vpc_endpoint_route_table_association.html) - (an association between a VPC endpoint and a single `route_table_id`), +[Security Groups](vpc_endpoint_security_group_association.html) - (an association between a VPC endpoint and a single `security_group_id`), +and [Subnets](vpc_endpoint_subnet_association.html) - (an association between a VPC endpoint and a single `subnet_id`) and +a VPC Endpoint resource with `route_table_ids` and `subnet_ids` attributes. +Do not use the same resource ID in both a VPC Endpoint resource and a VPC Endpoint Association resource. +Doing so will cause a conflict of associations and will overwrite the association. + +## Example Usage + +### Basic + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint import VpcEndpoint +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcEndpoint(self, "s3", + service_name="com.amazonaws.us-west-2.s3", + vpc_id=main.id + ) +``` + +### Basic w/ Tags + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint import VpcEndpoint +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcEndpoint(self, "s3", + service_name="com.amazonaws.us-west-2.s3", + tags={ + "Environment": "test" + }, + vpc_id=main.id + ) +``` + +### Interface Endpoint Type + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint import VpcEndpoint +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcEndpoint(self, "ec2", + private_dns_enabled=True, + security_group_ids=[sg1.id], + service_name="com.amazonaws.us-west-2.ec2", + vpc_endpoint_type="Interface", + vpc_id=main.id + ) +``` + +### Gateway Load Balancer Endpoint Type + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_caller_identity import DataAwsCallerIdentity +from imports.aws.vpc_endpoint import VpcEndpoint +from imports.aws.vpc_endpoint_service import VpcEndpointService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsCallerIdentity(self, "current") + example = VpcEndpointService(self, "example", + acceptance_required=False, + allowed_principals=[Token.as_string(current.arn)], + gateway_load_balancer_arns=[Token.as_string(aws_lb_example.arn)] + ) + aws_vpc_endpoint_example = VpcEndpoint(self, "example_2", + service_name=example.service_name, + subnet_ids=[Token.as_string(aws_subnet_example.id)], + vpc_endpoint_type=example.service_type, + vpc_id=Token.as_string(aws_vpc_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_endpoint_example.override_logical_id("example") +``` + +### Non-AWS Service + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, property_access, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_route53_zone import DataAwsRoute53Zone +from imports.aws.route53_record import Route53Record +from imports.aws.vpc_endpoint import VpcEndpoint +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + ptfe_service = VpcEndpoint(self, "ptfe_service", + private_dns_enabled=False, + security_group_ids=[Token.as_string(aws_security_group_ptfe_service.id)], + service_name=Token.as_string(var_ptfe_service.value), + subnet_ids=[subnet_ids], + vpc_endpoint_type="Interface", + vpc_id=vpc_id.string_value + ) + internal = DataAwsRoute53Zone(self, "internal", + name="vpc.internal.", + private_zone=True, + vpc_id=vpc_id.string_value + ) + aws_route53_record_ptfe_service = Route53Record(self, "ptfe_service_2", + name="ptfe.${" + internal.name + "}", + records=[ + Token.as_string( + property_access(ptfe_service.dns_entry, ["0", "\"dns_name\""])) + ], + ttl=Token.as_number("300"), + type="CNAME", + zone_id=Token.as_string(internal.zone_id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_route53_record_ptfe_service.override_logical_id("ptfe_service") +``` + +~> **NOTE The `dns_entry` output is a list of maps:** Terraform interpolation support for lists of maps requires the `lookup` and `[]` until full support of lists of maps is available + +## Argument Reference + +The following arguments are supported: + +* `service_name` - (Required) The service name. For AWS services the service name is usually in the form `com.amazonaws..` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `aws.sagemaker..notebook`). +* `vpc_id` - (Required) The ID of the VPC in which the endpoint will be used. +* `auto_accept` - (Optional) Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account). +* `policy` - (Optional) A policy to attach to the endpoint that controls access to the service. This is a JSON formatted string. Defaults to full access. All `Gateway` and some `Interface` endpoints support policies - see the [relevant AWS documentation](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) for more details. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). +* `private_dns_enabled` - (Optional; AWS services and AWS Marketplace partner services only) Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type `Interface`. +Defaults to `false`. +* `dns_options` - (Optional) The DNS options for the endpoint. See dns_options below. +* `ip_address_type` - (Optional) The IP address type for the endpoint. Valid values are `ipv4`, `dualstack`, and `ipv6`. +* `route_table_ids` - (Optional) One or more route table IDs. Applicable for endpoints of type `Gateway`. +* `subnet_ids` - (Optional) The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type `GatewayLoadBalancer` and `Interface`. +* `security_group_ids` - (Optional) The ID of one or more security groups to associate with the network interface. Applicable for endpoints of type `Interface`. +If no security groups are specified, the VPC's [default security group](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#DefaultSecurityGroup) is associated with the endpoint. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `vpc_endpoint_type` - (Optional) The VPC endpoint type, `Gateway`, `GatewayLoadBalancer`, or `Interface`. Defaults to `Gateway`. + +### dns_options + +* `dns_record_ip_type` - (Optional) The DNS records created for the endpoint. Valid values are `ipv4`, `dualstack`, `service-defined`, and `ipv6`. +* `private_dns_only_for_inbound_resolver_endpoint` - (Optional) Indicates whether to enable private DNS only for inbound endpoints. This option is available only for services that support both gateway and interface endpoints. It routes traffic that originates from the VPC to the gateway endpoint and traffic that originates from on-premises to the interface endpoint. Can only be specified if `private_dns_enabled` is `true`. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `10m`) +- `update` - (Default `10m`) +- `delete` - (Default `10m`) + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC endpoint. +* `arn` - The Amazon Resource Name (ARN) of the VPC endpoint. +* `cidr_blocks` - The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `Gateway`. +* `dns_entry` - The DNS entries for the VPC Endpoint. Applicable for endpoints of type `Interface`. DNS blocks are documented below. +* `network_interface_ids` - One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `Interface`. +* `owner_id` - The ID of the AWS account that owns the VPC endpoint. +* `prefix_list_id` - The prefix list ID of the exposed AWS service. Applicable for endpoints of type `Gateway`. +* `requester_managed` - Whether or not the VPC Endpoint is being managed by its service - `true` or `false`. +* `state` - The state of the VPC endpoint. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +DNS blocks (for `dns_entry`) support the following attributes: + +* `dns_name` - The DNS name. +* `hosted_zone_id` - The ID of the private hosted zone. + +## Import + +VPC Endpoints can be imported using the `vpc endpoint id`, e.g., + +``` +$ terraform import aws_vpc_endpoint.endpoint1 vpce-3ecf2a57 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint_connection_accepter.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint_connection_accepter.html.markdown new file mode 100644 index 00000000000..b5589d1b2bc --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint_connection_accepter.html.markdown @@ -0,0 +1,78 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_connection_accepter" +description: |- + Provides a resource to accept a pending VPC Endpoint accept request to VPC Endpoint Service. +--- + + + +# Resource: aws_vpc_endpoint_connection_accepter + +Provides a resource to accept a pending VPC Endpoint Connection accept request to VPC Endpoint Service. + +## Example Usage + +### Accept cross-account request + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint import VpcEndpoint +from imports.aws.vpc_endpoint_connection_accepter import VpcEndpointConnectionAccepter +from imports.aws.vpc_endpoint_service import VpcEndpointService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = VpcEndpoint(self, "example", + private_dns_enabled=False, + provider=alternate, + security_group_ids=[test.id], + service_name=Token.as_string(aws_vpc_endpoint_service_test.service_name), + vpc_endpoint_type="Interface", + vpc_id=test_alternate.id + ) + aws_vpc_endpoint_service_example = VpcEndpointService(self, "example_1", + acceptance_required=False, + network_load_balancer_arns=[Token.as_string(aws_lb_example.arn)] + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_endpoint_service_example.override_logical_id("example") + aws_vpc_endpoint_connection_accepter_example = + VpcEndpointConnectionAccepter(self, "example_2", + vpc_endpoint_id=example.id, + vpc_endpoint_service_id=Token.as_string(aws_vpc_endpoint_service_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_endpoint_connection_accepter_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are supported: + +* `vpc_endpoint_id` - (Required) AWS VPC Endpoint ID. +* `vpc_endpoint_service_id` - (Required) AWS VPC Endpoint Service ID. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC Endpoint Connection. +* `vpc_endpoint_state` - State of the VPC Endpoint. + +## Import + +VPC Endpoint Services can be imported using ID of the connection, which is the `VPC Endpoint Service ID` and `VPC Endpoint ID` separated by underscore (`_`). e.g. + +``` +$ terraform import aws_vpc_endpoint_connection_accepter.foo vpce-svc-0f97a19d3fa8220bc_vpce-010601a6db371e263 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint_connection_notification.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint_connection_notification.html.markdown new file mode 100644 index 00000000000..7b820597591 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint_connection_notification.html.markdown @@ -0,0 +1,93 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_connection_notification" +description: |- + Provides a VPC Endpoint connection notification resource. +--- + + + +# Resource: aws_vpc_endpoint_connection_notification + +Provides a VPC Endpoint connection notification resource. +Connection notifications notify subscribers of VPC Endpoint events. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_iam_policy_document import DataAwsIamPolicyDocument +from imports.aws.sns_topic import SnsTopic +from imports.aws.vpc_endpoint_connection_notification import VpcEndpointConnectionNotification +from imports.aws.vpc_endpoint_service import VpcEndpointService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + foo = VpcEndpointService(self, "foo", + acceptance_required=False, + network_load_balancer_arns=[test.arn] + ) + topic = DataAwsIamPolicyDocument(self, "topic", + statement=[DataAwsIamPolicyDocumentStatement( + actions=["SNS:Publish"], + effect="Allow", + principals=[DataAwsIamPolicyDocumentStatementPrincipals( + identifiers=["vpce.amazonaws.com"], + type="Service" + ) + ], + resources=["arn:aws:sns:*:*:vpce-notification-topic"] + ) + ] + ) + aws_sns_topic_topic = SnsTopic(self, "topic_2", + name="vpce-notification-topic", + policy=Token.as_string(topic.json) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_sns_topic_topic.override_logical_id("topic") + aws_vpc_endpoint_connection_notification_foo = + VpcEndpointConnectionNotification(self, "foo_3", + connection_events=["Accept", "Reject"], + connection_notification_arn=Token.as_string(aws_sns_topic_topic.arn), + vpc_endpoint_service_id=foo.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_endpoint_connection_notification_foo.override_logical_id("foo") +``` + +## Argument Reference + +The following arguments are supported: + +* `vpc_endpoint_service_id` - (Optional) The ID of the VPC Endpoint Service to receive notifications for. +* `vpc_endpoint_id` - (Optional) The ID of the VPC Endpoint to receive notifications for. +* `connection_notification_arn` - (Required) The ARN of the SNS topic for the notifications. +* `connection_events` - (Required) One or more endpoint [events](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVpcEndpointConnectionNotification.html#API_CreateVpcEndpointConnectionNotification_RequestParameters) for which to receive notifications. + +~> **NOTE:** One of `vpc_endpoint_service_id` or `vpc_endpoint_id` must be specified. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC connection notification. +* `state` - The state of the notification. +* `notification_type` - The type of notification. + +## Import + +VPC Endpoint connection notifications can be imported using the `VPC endpoint connection notification id`, e.g., + +``` +$ terraform import aws_vpc_endpoint_connection_notification.foo vpce-nfn-09e6ed3b4efba2263 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint_policy.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint_policy.html.markdown new file mode 100644 index 00000000000..a690d8360e2 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint_policy.html.markdown @@ -0,0 +1,88 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_policy" +description: |- + Provides a VPC Endpoint Policy resource. +--- + + + +# Resource: aws_vpc_endpoint_policy + +Provides a VPC Endpoint Policy resource. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, Fn, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_vpc_endpoint_service import DataAwsVpcEndpointService +from imports.aws.vpc import Vpc +from imports.aws.vpc_endpoint import VpcEndpoint +from imports.aws.vpc_endpoint_policy import VpcEndpointPolicy +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = Vpc(self, "example", + cidr_block="10.0.0.0/16" + ) + data_aws_vpc_endpoint_service_example = DataAwsVpcEndpointService(self, "example_1", + service="dynamodb" + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_aws_vpc_endpoint_service_example.override_logical_id("example") + aws_vpc_endpoint_example = VpcEndpoint(self, "example_2", + service_name=Token.as_string(data_aws_vpc_endpoint_service_example.service_name), + vpc_id=example.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_endpoint_example.override_logical_id("example") + aws_vpc_endpoint_policy_example = VpcEndpointPolicy(self, "example_3", + policy=Token.as_string( + Fn.jsonencode({ + "Statement": [{ + "Action": ["dynamodb:*"], + "Effect": "Allow", + "Principal": { + "AWS": "*" + }, + "Resource": "*", + "Sid": "AllowAll" + } + ], + "Version": "2012-10-17" + })), + vpc_endpoint_id=Token.as_string(aws_vpc_endpoint_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_endpoint_policy_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are supported: + +* `vpc_endpoint_id` - (Required) The VPC Endpoint ID. +* `policy` - (Optional) A policy to attach to the endpoint that controls access to the service. Defaults to full access. All `Gateway` and some `Interface` endpoints support policies - see the [relevant AWS documentation](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) for more details. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC endpoint. + +## Import + +VPC Endpoint Policies can be imported using the `id`, e.g. + +``` +$ terraform import aws_vpc_endpoint_policy.example vpce-3ecf2a57 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint_route_table_association.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint_route_table_association.html.markdown new file mode 100644 index 00000000000..a6b3734cd2e --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint_route_table_association.html.markdown @@ -0,0 +1,57 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_route_table_association" +description: |- + Manages a VPC Endpoint Route Table Association +--- + + + +# Resource: aws_vpc_endpoint_route_table_association + +Manages a VPC Endpoint Route Table Association + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint_route_table_association import VpcEndpointRouteTableAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcEndpointRouteTableAssociation(self, "example", + route_table_id=Token.as_string(aws_route_table_example.id), + vpc_endpoint_id=Token.as_string(aws_vpc_endpoint_example.id) + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `route_table_id` - (Required) Identifier of the EC2 Route Table to be associated with the VPC Endpoint. +* `vpc_endpoint_id` - (Required) Identifier of the VPC Endpoint with which the EC2 Route Table will be associated. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - A hash of the EC2 Route Table and VPC Endpoint identifiers. + +## Import + +VPC Endpoint Route Table Associations can be imported using `vpc_endpoint_id` together with `route_table_id`, +e.g., + +``` +$ terraform import aws_vpc_endpoint_route_table_association.example vpce-aaaaaaaa/rtb-bbbbbbbb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint_security_group_association.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint_security_group_association.html.markdown new file mode 100644 index 00000000000..2f5e5c7702c --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint_security_group_association.html.markdown @@ -0,0 +1,57 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_security_group_association" +description: |- + Provides a resource to create an association between a VPC endpoint and a security group. +--- + + + +# Resource: aws_vpc_endpoint_security_group_association + +Provides a resource to create an association between a VPC endpoint and a security group. + +~> **NOTE on VPC Endpoints and VPC Endpoint Security Group Associations:** Terraform provides +both a standalone VPC Endpoint Security Group Association (an association between a VPC endpoint +and a single `security_group_id`) and a [VPC Endpoint](vpc_endpoint.html) resource with a `security_group_ids` +attribute. Do not use the same security group ID in both a VPC Endpoint resource and a VPC Endpoint Security +Group Association resource. Doing so will cause a conflict of associations and will overwrite the association. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint_security_group_association import VpcEndpointSecurityGroupAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcEndpointSecurityGroupAssociation(self, "sg_ec2", + security_group_id=sg.id, + vpc_endpoint_id=ec2.id + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `security_group_id` - (Required) The ID of the security group to be associated with the VPC endpoint. +* `vpc_endpoint_id` - (Required) The ID of the VPC endpoint with which the security group will be associated. +* `replace_default_association` - (Optional) Whether this association should replace the association with the VPC's default security group that is created when no security groups are specified during VPC endpoint creation. At most 1 association per-VPC endpoint should be configured with `replace_default_association = true`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the association. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint_service.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint_service.html.markdown new file mode 100644 index 00000000000..51bfa796173 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint_service.html.markdown @@ -0,0 +1,103 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_service" +description: |- + Provides a VPC Endpoint Service resource. +--- + + + +# Resource: aws_vpc_endpoint_service + +Provides a VPC Endpoint Service resource. +Service consumers can create an _Interface_ [VPC Endpoint](vpc_endpoint.html) to connect to the service. + +~> **NOTE on VPC Endpoint Services and VPC Endpoint Service Allowed Principals:** Terraform provides +both a standalone [VPC Endpoint Service Allowed Principal](vpc_endpoint_service_allowed_principal.html) resource +and a VPC Endpoint Service resource with an `allowed_principals` attribute. Do not use the same principal ARN in both +a VPC Endpoint Service resource and a VPC Endpoint Service Allowed Principal resource. Doing so will cause a conflict +and will overwrite the association. + +## Example Usage + +### Network Load Balancers + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint_service import VpcEndpointService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcEndpointService(self, "example", + acceptance_required=False, + network_load_balancer_arns=[Token.as_string(aws_lb_example.arn)] + ) +``` + +### Gateway Load Balancers + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint_service import VpcEndpointService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcEndpointService(self, "example", + acceptance_required=False, + gateway_load_balancer_arns=[Token.as_string(aws_lb_example.arn)] + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `acceptance_required` - (Required) Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`. +* `allowed_principals` - (Optional) The ARNs of one or more principals allowed to discover the endpoint service. +* `gateway_load_balancer_arns` - (Optional) Amazon Resource Names (ARNs) of one or more Gateway Load Balancers for the endpoint service. +* `network_load_balancer_arns` - (Optional) Amazon Resource Names (ARNs) of one or more Network Load Balancers for the endpoint service. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `private_dns_name` - (Optional) The private DNS name for the service. +* `supported_ip_address_types` - (Optional) The supported IP address types. The possible values are `ipv4` and `ipv6`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC endpoint service. +* `availability_zones` - A set of Availability Zones in which the service is available. +* `arn` - The Amazon Resource Name (ARN) of the VPC endpoint service. +* `base_endpoint_dns_names` - A set of DNS names for the service. +* `manages_vpc_endpoints` - Whether or not the service manages its VPC endpoints - `true` or `false`. +* `service_name` - The service name. +* `service_type` - The service type, `Gateway` or `Interface`. +* `state` - The state of the VPC endpoint service. +* `private_dns_name_configuration` - List of objects containing information about the endpoint service private DNS name configuration. + * `name` - Name of the record subdomain the service provider needs to create. + * `state` - Verification state of the VPC endpoint service. Consumers of the endpoint service can use the private name only when the state is `verified`. + * `type` - Endpoint service verification type, for example `TXT`. + * `value` - Value the service provider adds to the private DNS name domain record before verification. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +VPC Endpoint Services can be imported using the `VPC endpoint service id`, e.g., + +``` +$ terraform import aws_vpc_endpoint_service.foo vpce-svc-0f97a19d3fa8220bc +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint_service_allowed_principal.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint_service_allowed_principal.html.markdown new file mode 100644 index 00000000000..560655f2d41 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint_service_allowed_principal.html.markdown @@ -0,0 +1,58 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_service_allowed_principal" +description: |- + Provides a resource to allow a principal to discover a VPC endpoint service. +--- + + + +# Resource: aws_vpc_endpoint_service_allowed_principal + +Provides a resource to allow a principal to discover a VPC endpoint service. + +~> **NOTE on VPC Endpoint Services and VPC Endpoint Service Allowed Principals:** Terraform provides +both a standalone [VPC Endpoint Service Allowed Principal](vpc_endpoint_service_allowed_principal.html) resource +and a VPC Endpoint Service resource with an `allowed_principals` attribute. Do not use the same principal ARN in both +a VPC Endpoint Service resource and a VPC Endpoint Service Allowed Principal resource. Doing so will cause a conflict +and will overwrite the association. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_caller_identity import DataAwsCallerIdentity +from imports.aws.vpc_endpoint_service_allowed_principal import VpcEndpointServiceAllowedPrincipal +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsCallerIdentity(self, "current") + VpcEndpointServiceAllowedPrincipal(self, "allow_me_to_foo", + principal_arn=Token.as_string(current.arn), + vpc_endpoint_service_id=foo.id + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `vpc_endpoint_service_id` - (Required) The ID of the VPC endpoint service to allow permission. +* `principal_arn` - (Required) The ARN of the principal to allow permissions. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the association. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_endpoint_subnet_association.html.markdown b/website/docs/cdktf/python/r/vpc_endpoint_subnet_association.html.markdown new file mode 100644 index 00000000000..cadea84ea7d --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_endpoint_subnet_association.html.markdown @@ -0,0 +1,72 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_subnet_association" +description: |- + Provides a resource to create an association between a VPC endpoint and a subnet. +--- + + + +# Resource: aws_vpc_endpoint_subnet_association + +Provides a resource to create an association between a VPC endpoint and a subnet. + +~> **NOTE on VPC Endpoints and VPC Endpoint Subnet Associations:** Terraform provides +both a standalone VPC Endpoint Subnet Association (an association between a VPC endpoint +and a single `subnet_id`) and a [VPC Endpoint](vpc_endpoint.html) resource with a `subnet_ids` +attribute. Do not use the same subnet ID in both a VPC Endpoint resource and a VPC Endpoint Subnet +Association resource. Doing so will cause a conflict of associations and will overwrite the association. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_endpoint_subnet_association import VpcEndpointSubnetAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcEndpointSubnetAssociation(self, "sn_ec2", + subnet_id=sn.id, + vpc_endpoint_id=ec2.id + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `vpc_endpoint_id` - (Required) The ID of the VPC endpoint with which the subnet will be associated. +* `subnet_id` - (Required) The ID of the subnet to be associated with the VPC endpoint. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the association. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `10m`) +- `delete` - (Default `10m`) + +## Import + +VPC Endpoint Subnet Associations can be imported using `vpc_endpoint_id` together with `subnet_id`, +e.g., + +``` +$ terraform import aws_vpc_endpoint_subnet_association.example vpce-aaaaaaaa/subnet-bbbbbbbbbbbbbbbbb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam.html.markdown b/website/docs/cdktf/python/r/vpc_ipam.html.markdown new file mode 100644 index 00000000000..d0690383d58 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam.html.markdown @@ -0,0 +1,118 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam" +description: |- + Provides an IPAM resource. +--- + + + +# Resource: aws_vpc_ipam + +Provides an IPAM resource. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + VpcIpam(self, "main", + description="My IPAM", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ], + tags={ + "Test": "Main" + } + ) +``` + +Shared with multiple operating_regions: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import VariableType, TerraformVariable, Fn, Token, TerraformIterator, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + # Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + # You can read more about this at https://cdk.tf/variables + ipam_regions = TerraformVariable(self, "ipam_regions", + default=["us-east-1", "us-west-2"], + type=VariableType.ANY + ) + current = DataAwsRegion(self, "current") + all_ipam_regions = Fn.distinct( + Token.as_any(Fn.concat([[current.name], ipam_regions.value]))) + # In most cases loops should be handled in the programming language context and + # not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + # you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + # you need to keep this like it is. + main_dynamic_iterator0 = TerraformIterator.from_list( + Token.as_any(all_ipam_regions)) + VpcIpam(self, "main", + description="multi region ipam", + operating_regions=main_dynamic_iterator0.dynamic({ + "region_name": main_dynamic_iterator0.value + }) + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `description` - (Optional) A description for the IPAM. +* `operating_regions` - (Required) Determines which locales can be chosen when you create pools. Locale is the Region where you want to make an IPAM pool available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. You specify a region using the [region_name](#operating_regions) parameter. You **must** set your provider block region as an operating_region. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `cascade` - (Optional) Enables you to quickly delete an IPAM, private scopes, pools in private scopes, and any allocations in the pools in private scopes. + +### operating_regions + +* `region_name` - (Required) The name of the Region you want to add to the IPAM. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of IPAM +* `id` - The ID of the IPAM +* `default_resource_discovery_id` - The IPAM's default resource discovery ID. +* `default_resource_discovery_association_id` - The IPAM's default resource discovery association ID. +* `private_default_scope_id` - The ID of the IPAM's private scope. A scope is a top-level container in IPAM. Each scope represents an IP-independent network. Scopes enable you to represent networks where you have overlapping IP space. When you create an IPAM, IPAM automatically creates two scopes: public and private. The private scope is intended for private IP space. The public scope is intended for all internet-routable IP space. +* `public_default_scope_id` - The ID of the IPAM's public scope. A scope is a top-level container in IPAM. Each scope represents an IP-independent network. Scopes enable you to represent networks where you have overlapping IP space. When you create an IPAM, IPAM automatically creates two scopes: public and private. The private scope is intended for private +IP space. The public scope is intended for all internet-routable IP space. +* `scope_count` - The number of scopes in the IPAM. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +IPAMs can be imported using the `ipam id`, e.g. + +``` +$ terraform import aws_vpc_ipam.example ipam-0178368ad2146a492 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam_organization_admin_account.html.markdown b/website/docs/cdktf/python/r/vpc_ipam_organization_admin_account.html.markdown new file mode 100644 index 00000000000..21817a47bcb --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam_organization_admin_account.html.markdown @@ -0,0 +1,68 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_organization_admin_account" +description: |- + Enables the IPAM Service and promotes an account to delegated administrator for the service. +--- + + + +# Resource: aws_vpc_ipam_organization_admin_account + +Enables the IPAM Service and promotes a delegated administrator. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_caller_identity import DataAwsCallerIdentity +from imports.aws.provider import AwsProvider +from imports.aws.vpc_ipam_organization_admin_account import VpcIpamOrganizationAdminAccount +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + ipam_delegate_account = AwsProvider(self, "aws", + alias="ipam_delegate_account" + ) + delegated = DataAwsCallerIdentity(self, "delegated", + provider=ipam_delegate_account + ) + VpcIpamOrganizationAdminAccount(self, "example", + delegated_admin_account_id=Token.as_string(delegated.account_id) + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `delegated_admin_account_id` - (Required) + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Organizations ARN for the delegate account. +* `id` - The Organizations member account ID that you want to enable as the IPAM account. +* `email` - The Organizations email for the delegate account. +* `name` - The Organizations name for the delegate account. +* `service_principal` - The AWS service principal. + +## Import + +IPAMs can be imported using the `delegate account id`, e.g. + +``` +$ terraform import aws_vpc_ipam_organization_admin_account.example 12345678901 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam_pool.html.markdown b/website/docs/cdktf/python/r/vpc_ipam_pool.html.markdown new file mode 100644 index 00000000000..e98bc4d531c --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam_pool.html.markdown @@ -0,0 +1,130 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool" +description: |- + Provides a IP address pool resource for IPAM. +--- + + + +# Resource: aws_vpc_ipam_pool + +Provides an IP address pool resource for IPAM. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_pool import VpcIpamPool +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + example = VpcIpam(self, "example", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + aws_vpc_ipam_pool_example = VpcIpamPool(self, "example_2", + address_family="ipv4", + ipam_scope_id=example.private_default_scope_id, + locale=Token.as_string(current.name) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_example.override_logical_id("example") +``` + +Nested Pools: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_pool import VpcIpamPool +from imports.aws.vpc_ipam_pool_cidr import VpcIpamPoolCidr +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + example = VpcIpam(self, "example", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + parent = VpcIpamPool(self, "parent", + address_family="ipv4", + ipam_scope_id=example.private_default_scope_id + ) + VpcIpamPoolCidr(self, "parent_test", + cidr="172.2.0.0/16", + ipam_pool_id=parent.id + ) + child = VpcIpamPool(self, "child", + address_family="ipv4", + ipam_scope_id=example.private_default_scope_id, + locale=Token.as_string(current.name), + source_ipam_pool_id=parent.id + ) + VpcIpamPoolCidr(self, "child_test", + cidr="172.2.0.0/24", + ipam_pool_id=child.id + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `address_family` - (Optional) The IP protocol assigned to this pool. You must choose either IPv4 or IPv6 protocol for a pool. +* `allocation_default_netmask_length` - (Optional) A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16 (unless you provide a different netmask value when you create the new allocation). +* `allocation_max_netmask_length` - (Optional) The maximum netmask length that will be required for CIDR allocations in this pool. +* `allocation_min_netmask_length` - (Optional) The minimum netmask length that will be required for CIDR allocations in this pool. +* `allocation_resource_tags` - (Optional) Tags that are required for resources that use CIDRs from this IPAM pool. Resources that do not have these tags will not be allowed to allocate space from the pool. If the resources have their tags changed after they have allocated space or if the allocation tagging requirements are changed on the pool, the resource may be marked as noncompliant. +* `auto_import` - (Optional) If you include this argument, IPAM automatically imports any VPCs you have in your scope that fall +within the CIDR range in the pool. +* `aws_service` - (Optional) Limits which AWS service the pool can be used in. Only useable on public scopes. Valid Values: `ec2`. +* `description` - (Optional) A description for the IPAM pool. +* `ipam_scope_id` - (Optional) The ID of the scope in which you would like to create the IPAM pool. +* `locale` - (Optional) The locale in which you would like to create the IPAM pool. Locale is the Region where you want to make an IPAM pool available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. Possible values: Any AWS region, such as `us-east-1`. +* `publicly_advertisable` - (Optional) Defines whether or not IPv6 pool space is publicly advertisable over the internet. This argument is required if `address_family = "ipv6"` and `public_ip_source = "byoip"`, default is `false`. This option is not available for IPv4 pool space or if `public_ip_source = "amazon"`. +* `public_ip_source` - (Optional) The IP address source for pools in the public scope. Only used for provisioning IP address CIDRs to pools in the public scope. Valid values are `byoip` or `amazon`. Default is `byoip`. +* `source_ipam_pool_id` - (Optional) The ID of the source IPAM pool. Use this argument to create a child pool within an existing pool. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of IPAM +* `id` - The ID of the IPAM +* `state` - The ID of the IPAM +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +IPAMs can be imported using the `ipam pool id`, e.g. + +``` +$ terraform import aws_vpc_ipam_pool.example ipam-pool-0958f95207d978e1e +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam_pool_cidr.html.markdown b/website/docs/cdktf/python/r/vpc_ipam_pool_cidr.html.markdown new file mode 100644 index 00000000000..9bdb0d81815 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam_pool_cidr.html.markdown @@ -0,0 +1,134 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool_cidr" +description: |- + Provisions a CIDR from an IPAM address pool. +--- + + + +# Resource: aws_vpc_ipam_pool_cidr + +Provisions a CIDR from an IPAM address pool. + +~> **NOTE:** Provisioning Public IPv4 or Public IPv6 require [steps outside the scope of this resource](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip). The resource accepts `message` and `signature` as part of the `cidr_authorization_context` attribute but those must be generated ahead of time. Public IPv6 CIDRs that are provisioned into a Pool with `publicly_advertisable = true` and all public IPv4 CIDRs also require creating a Route Origin Authorization (ROA) object in your Regional Internet Registry (RIR). + +~> **NOTE:** In order to deprovision CIDRs all Allocations must be released. Allocations created by a VPC take up to 30 minutes to be released. However, for IPAM to properly manage the removal of allocation records created by VPCs and other resources, you must [grant it permissions](https://docs.aws.amazon.com/vpc/latest/ipam/choose-single-user-or-orgs-ipam.html) in +either a single account or organizationally. If you are unable to deprovision a cidr after waiting over 30 minutes, you may be missing the Service Linked Role. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_pool import VpcIpamPool +from imports.aws.vpc_ipam_pool_cidr import VpcIpamPoolCidr +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + example = VpcIpam(self, "example", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + aws_vpc_ipam_pool_example = VpcIpamPool(self, "example_2", + address_family="ipv4", + ipam_scope_id=example.private_default_scope_id, + locale=Token.as_string(current.name) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_example.override_logical_id("example") + aws_vpc_ipam_pool_cidr_example = VpcIpamPoolCidr(self, "example_3", + cidr="172.2.0.0/16", + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_example.override_logical_id("example") +``` + +Provision Public IPv6 Pool CIDRs: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_pool import VpcIpamPool +from imports.aws.vpc_ipam_pool_cidr import VpcIpamPoolCidr +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + example = VpcIpam(self, "example", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + ipv6_test_public = VpcIpamPool(self, "ipv6_test_public", + address_family="ipv6", + advertisable=False, + aws_service="ec2", + description="public ipv6", + ipam_scope_id=example.public_default_scope_id, + locale="us-east-1" + ) + aws_vpc_ipam_pool_cidr_ipv6_test_public = VpcIpamPoolCidr(self, "ipv6_test_public_3", + cidr=ipv6_cidr.string_value, + cidr_authorization_context=VpcIpamPoolCidrCidrAuthorizationContext( + message=message.string_value, + signature=signature.string_value + ), + ipam_pool_id=ipv6_test_public.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_ipv6_test_public.override_logical_id("ipv6_test_public") +``` + +## Argument Reference + +The following arguments are supported: + +* `cidr` - (Optional) The CIDR you want to assign to the pool. Conflicts with `netmask_length`. +* `cidr_authorization_context` - (Optional) A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP. This is not stored in the state file. See [cidr_authorization_context](#cidr_authorization_context) for more information. +* `ipam_pool_id` - (Required) The ID of the pool to which you want to assign a CIDR. +* `netmask_length` - (Optional) If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with `cidr`. + +### cidr_authorization_context + +* `message` - (Optional) The plain-text authorization message for the prefix and account. +* `signature` - (Optional) The signed authorization message for the prefix and account. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the IPAM Pool Cidr concatenated with the IPAM Pool ID. +* `ipam_pool_cidr_id` - The unique ID generated by AWS for the pool cidr. Typically this is the resource `id` but this attribute was added to the API calls after the fact and is therefore not used as the terraform resource id. + +## Import + +IPAMs can be imported using the `_`. Please note we **DO NOT** use the ipam pool cidr id as this was introduced after the resource already existed. An import example: + +``` +$ terraform import aws_vpc_ipam_pool_cidr.example 172.2.0.0/24_ipam-pool-0e634f5a1517cccdc +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam_pool_cidr_allocation.html.markdown b/website/docs/cdktf/python/r/vpc_ipam_pool_cidr_allocation.html.markdown new file mode 100644 index 00000000000..e33b503282f --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam_pool_cidr_allocation.html.markdown @@ -0,0 +1,139 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool_cidr_allocation" +description: |- + Allocates (reserves) a CIDR from an IPAM address pool, preventing usage by IPAM. +--- + + + +# Resource: aws_vpc_ipam_pool_cidr_allocation + +Allocates (reserves) a CIDR from an IPAM address pool, preventing usage by IPAM. Only works for private IPv4. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_pool import VpcIpamPool +from imports.aws.vpc_ipam_pool_cidr import VpcIpamPoolCidr +from imports.aws.vpc_ipam_pool_cidr_allocation import VpcIpamPoolCidrAllocation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + example = VpcIpam(self, "example", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + aws_vpc_ipam_pool_example = VpcIpamPool(self, "example_2", + address_family="ipv4", + ipam_scope_id=example.private_default_scope_id, + locale=Token.as_string(current.name) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_example.override_logical_id("example") + aws_vpc_ipam_pool_cidr_example = VpcIpamPoolCidr(self, "example_3", + cidr="172.2.0.0/16", + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_example.override_logical_id("example") + aws_vpc_ipam_pool_cidr_allocation_example = VpcIpamPoolCidrAllocation(self, "example_4", + cidr="172.2.0.0/24", + depends_on=[aws_vpc_ipam_pool_cidr_example], + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_allocation_example.override_logical_id("example") +``` + +With the `disallowed_cidrs` attribute: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_pool import VpcIpamPool +from imports.aws.vpc_ipam_pool_cidr import VpcIpamPoolCidr +from imports.aws.vpc_ipam_pool_cidr_allocation import VpcIpamPoolCidrAllocation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + example = VpcIpam(self, "example", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + aws_vpc_ipam_pool_example = VpcIpamPool(self, "example_2", + address_family="ipv4", + ipam_scope_id=example.private_default_scope_id, + locale=Token.as_string(current.name) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_example.override_logical_id("example") + aws_vpc_ipam_pool_cidr_example = VpcIpamPoolCidr(self, "example_3", + cidr="172.2.0.0/16", + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_example.override_logical_id("example") + aws_vpc_ipam_pool_cidr_allocation_example = VpcIpamPoolCidrAllocation(self, "example_4", + depends_on=[aws_vpc_ipam_pool_cidr_example], + disallowed_cidrs=["172.2.0.0/28"], + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_example.id), + netmask_length=28 + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_allocation_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are supported: + +* `cidr` - (Optional) The CIDR you want to assign to the pool. +* `description` - (Optional) The description for the allocation. +* `disallowed_cidrs` - (Optional) Exclude a particular CIDR range from being returned by the pool. +* `ipam_pool_id` - (Required) The ID of the pool to which you want to assign a CIDR. +* `netmask_length` - (Optional) The netmask length of the CIDR you would like to allocate to the IPAM pool. Valid Values: `0-128`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the allocation. +* `resource_id` - The ID of the resource. +* `resource_owner` - The owner of the resource. +* `resource_type` - The type of the resource. + +## Import + +IPAM allocations can be imported using the `allocation id` and `pool id`, separated by `_`, e.g. + +``` +$ terraform import aws_vpc_ipam_pool_cidr_allocation.example ipam-pool-alloc-0dc6d196509c049ba8b549ff99f639736_ipam-pool-07cfb559e0921fcbe +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam_preview_next_cidr.html.markdown b/website/docs/cdktf/python/r/vpc_ipam_preview_next_cidr.html.markdown new file mode 100644 index 00000000000..10ae09302b2 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam_preview_next_cidr.html.markdown @@ -0,0 +1,80 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_preview_next_cidr" +description: |- + Previews a CIDR from an IPAM address pool. +--- + + + +# Resource: aws_vpc_ipam_preview_next_cidr + +Previews a CIDR from an IPAM address pool. Only works for private IPv4. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_pool import VpcIpamPool +from imports.aws.vpc_ipam_pool_cidr import VpcIpamPoolCidr +from imports.aws.vpc_ipam_preview_next_cidr import VpcIpamPreviewNextCidr +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + example = VpcIpam(self, "example", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + aws_vpc_ipam_pool_example = VpcIpamPool(self, "example_2", + address_family="ipv4", + ipam_scope_id=example.private_default_scope_id, + locale=Token.as_string(current.name) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_example.override_logical_id("example") + aws_vpc_ipam_pool_cidr_example = VpcIpamPoolCidr(self, "example_3", + cidr="172.2.0.0/16", + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_pool_cidr_example.override_logical_id("example") + aws_vpc_ipam_preview_next_cidr_example = VpcIpamPreviewNextCidr(self, "example_4", + depends_on=[aws_vpc_ipam_pool_cidr_example], + disallowed_cidrs=["172.2.0.0/32"], + ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_example.id), + netmask_length=28 + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_preview_next_cidr_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are supported: + +* `disallowed_cidrs` - (Optional) Exclude a particular CIDR range from being returned by the pool. +* `ipam_pool_id` - (Required) The ID of the pool to which you want to assign a CIDR. +* `netmask_length` - (Optional) The netmask length of the CIDR you would like to preview from the IPAM pool. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `cidr` - The previewed CIDR from the pool. +* `id` - The ID of the preview. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam_resource_discovery.html.markdown b/website/docs/cdktf/python/r/vpc_ipam_resource_discovery.html.markdown new file mode 100644 index 00000000000..5a85e9b8a00 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam_resource_discovery.html.markdown @@ -0,0 +1,76 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_resource_discovery" +description: |- + Provides an IPAM Resource Discovery resource. +--- + + + +# Resource: aws_vpc_ipam_resource_discovery + +Provides an IPAM Resource Discovery resource. IPAM Resource Discoveries are resources meant for multi-organization customers. If you wish to use a single IPAM across multiple orgs, a resource discovery can be created and shared from a subordinate organization to the management organizations IPAM delegated admin account. For a full deployment example, see `aws_vpc_ipam_resource_discovery_association` resource. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam_resource_discovery import VpcIpamResourceDiscovery +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + VpcIpamResourceDiscovery(self, "main", + description="My IPAM Resource Discovery", + operating_regions=[VpcIpamResourceDiscoveryOperatingRegions( + region_name=Token.as_string(current.name) + ) + ], + tags={ + "Test": "Main" + } + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `description` - (Optional) A description for the IPAM Resource Discovery. +* `operating_regions` - (Required) Determines which regions the Resource Discovery will enable IPAM features for usage and monitoring. Locale is the Region where you want to make an IPAM pool available for allocations. You can only create pools with locales that match the operating Regions of the IPAM Resource Discovery. You can only create VPCs from a pool whose locale matches the VPC's Region. You specify a region using the [region_name](#operating_regions) parameter. **You must set your provider block region as an operating_region.** +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### operating_regions + +* `region_name` - (Required) The name of the Region you want to add to the IPAM. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of IPAM Resource Discovery +* `id` - The ID of the IPAM Resource Discovery +* `is_default` - A boolean to identify if the Resource Discovery is the accounts default resource discovery +* `owner_id` - The account ID for the account that manages the Resource Discovery +* `ipam_resource_discovery_region` - The home region of the Resource Discovery +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +IPAMs can be imported using the `ipam resource discovery id`, e.g. + +``` +$ terraform import aws_vpc_ipam_resource_discovery.example ipam-res-disco-0178368ad2146a492 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam_resource_discovery_association.html.markdown b/website/docs/cdktf/python/r/vpc_ipam_resource_discovery_association.html.markdown new file mode 100644 index 00000000000..40b5572856a --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam_resource_discovery_association.html.markdown @@ -0,0 +1,71 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_resource_discovery_association" +description: |- + Provides an IPAM Resource Discovery Association resource. +--- + + + +# Resource: aws_vpc_ipam_resource_discovery_association + +Provides an association between an Amazon IP Address Manager (IPAM) and a IPAM Resource Discovery. IPAM Resource Discoveries are resources meant for multi-organization customers. If you wish to use a single IPAM across multiple orgs, a resource discovery can be created and shared from a subordinate organization to the management organizations IPAM delegated admin account. + +Once an association is created between two organizations via IPAM & a IPAM Resource Discovery, IPAM Pools can be shared via Resource Access Manager (RAM) to accounts in the subordinate organization; these RAM shares must be accepted by the end user account. Pools can then also discover and monitor IPAM resources in the subordinate organization. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_ipam_resource_discovery_association import VpcIpamResourceDiscoveryAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcIpamResourceDiscoveryAssociation(self, "test", + ipam_id=Token.as_string(aws_vpc_ipam_test.id), + ipam_resource_discovery_id=Token.as_string(aws_vpc_ipam_resource_discovery_test.id), + tags={ + "Name": "test" + } + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `ipam_id` - (Required) The ID of the IPAM to associate. +* `ipam_resource_discovery_id` - (Required) The ID of the Resource Discovery to associate. +* `tags` - (Optional) A map of tags to add to the IPAM resource discovery association resource. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of IPAM Resource Discovery Association. +* `id` - The ID of the IPAM Resource Discovery Association. +* `owner_id` - The account ID for the account that manages the Resource Discovery +* `ipam_arn` - The Amazon Resource Name (ARN) of the IPAM. +* `ipam_region` - The home region of the IPAM. +* `is_default` - A boolean to identify if the Resource Discovery is the accounts default resource discovery. +* `state` - The lifecycle state of the association when you associate or disassociate a resource discovery. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +IPAMs can be imported using the `ipam resource discovery association id`, e.g. + +``` +$ terraform import aws_vpc_ipam_resource_discovery_association.example ipam-res-disco-assoc-0178368ad2146a492 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipam_scope.html.markdown b/website/docs/cdktf/python/r/vpc_ipam_scope.html.markdown new file mode 100644 index 00000000000..b7f1eebf0cc --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipam_scope.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_scope" +description: |- + Creates a scope for AWS IPAM. +--- + + + +# Resource: aws_vpc_ipam_scope + +Creates a scope for AWS IPAM. + +## Example Usage + +Basic usage: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_region import DataAwsRegion +from imports.aws.vpc_ipam import VpcIpam +from imports.aws.vpc_ipam_scope import VpcIpamScope +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + current = DataAwsRegion(self, "current") + example = VpcIpam(self, "example", + operating_regions=[VpcIpamOperatingRegions( + region_name=Token.as_string(current.name) + ) + ] + ) + aws_vpc_ipam_scope_example = VpcIpamScope(self, "example_2", + description="Another Scope", + ipam_id=example.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipam_scope_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are supported: + +* `ipam_id` - The ID of the IPAM for which you're creating this scope. +* `description` - (Optional) A description for the scope you're creating. +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the scope. +* `id` - The ID of the IPAM Scope. +* `ipam_arn` - The ARN of the IPAM for which you're creating this scope. +* `is_default` - Defines if the scope is the default scope or not. +* `pool_count` - The number of pools in the scope. +* `type` - The type of the scope. + +## Import + +IPAMs can be imported using the `scope_id`, e.g. + +``` +$ terraform import aws_vpc_ipam_scope.example ipam-scope-0513c69f283d11dfb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipv4_cidr_block_association.html.markdown b/website/docs/cdktf/python/r/vpc_ipv4_cidr_block_association.html.markdown new file mode 100644 index 00000000000..072452a39dc --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipv4_cidr_block_association.html.markdown @@ -0,0 +1,72 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_ipv4_cidr_block_association" +description: |- + Associate additional IPv4 CIDR blocks with a VPC +--- + + + +# Resource: aws_vpc_ipv4_cidr_block_association + +Provides a resource to associate additional IPv4 CIDR blocks with a VPC. + +When a VPC is created, a primary IPv4 CIDR block for the VPC must be specified. +The `aws_vpc_ipv4_cidr_block_association` resource allows further IPv4 CIDR blocks to be added to the VPC. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc import Vpc +from imports.aws.vpc_ipv4_cidr_block_association import VpcIpv4CidrBlockAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + main = Vpc(self, "main", + cidr_block="10.0.0.0/16" + ) + VpcIpv4CidrBlockAssociation(self, "secondary_cidr", + cidr_block="172.2.0.0/16", + vpc_id=main.id + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `cidr_block` - (Optional) The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv4_netmask_length`. +* `ipv4_ipam_pool_id` - (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization. +* `ipv4_netmask_length` - (Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a `ipv4_ipam_pool_id`. +* `vpc_id` - (Required) The ID of the VPC to make the association with. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC CIDR association + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `10m`) +- `delete` - (Default `10m`) + +## Import + +`aws_vpc_ipv4_cidr_block_association` can be imported by using the VPC CIDR Association ID, e.g., + +``` +$ terraform import aws_vpc_ipv4_cidr_block_association.example vpc-cidr-assoc-xxxxxxxx +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_ipv6_cidr_block_association.html.markdown b/website/docs/cdktf/python/r/vpc_ipv6_cidr_block_association.html.markdown new file mode 100644 index 00000000000..36d68b4c96d --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_ipv6_cidr_block_association.html.markdown @@ -0,0 +1,73 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_ipv6_cidr_block_association" +description: |- + Associate additional IPv6 CIDR blocks with a VPC +--- + + + +# Resource: aws_vpc_ipv6_cidr_block_association + +Provides a resource to associate additional IPv6 CIDR blocks with a VPC. + +The `aws_vpc_ipv6_cidr_block_association` resource allows IPv6 CIDR blocks to be added to the VPC. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc import Vpc +from imports.aws.vpc_ipv6_cidr_block_association import VpcIpv6CidrBlockAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + test = Vpc(self, "test", + cidr_block="10.0.0.0/16" + ) + aws_vpc_ipv6_cidr_block_association_test = VpcIpv6CidrBlockAssociation(self, "test_1", + ipv6_ipam_pool_id=Token.as_string(aws_vpc_ipam_pool_test.id), + vpc_id=test.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_ipv6_cidr_block_association_test.override_logical_id("test") +``` + +## Argument Reference + +The following arguments are supported: + +* `ipv6_cidr_block` - (Optional) The IPv6 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv6_netmask_length`. This parameter is required if `ipv6_netmask_length` is not set and he IPAM pool does not have `allocation_default_netmask` set. +* `ipv6_ipam_pool_id` - (Required) The ID of an IPv6 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. +* `ipv6_netmask_length` - (Optional) The netmask length of the IPv6 CIDR you want to allocate to this VPC. Requires specifying a `ipv6_ipam_pool_id`. This parameter is optional if the IPAM pool has `allocation_default_netmask` set, otherwise it or `cidr_block` are required +* `vpc_id` - (Required) The ID of the VPC to make the association with. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `10m`) +- `delete` - (Default `10m`) + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC CIDR association + +## Import + +`aws_vpc_ipv6_cidr_block_association` can be imported by using the VPC CIDR Association ID, e.g., + +``` +$ terraform import aws_vpc_ipv6_cidr_block_association.example vpc-cidr-assoc-xxxxxxxx +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_network_performance_metric_subscription.html.markdown b/website/docs/cdktf/python/r/vpc_network_performance_metric_subscription.html.markdown new file mode 100644 index 00000000000..2806c10e30b --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_network_performance_metric_subscription.html.markdown @@ -0,0 +1,50 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_network_performance_metric_subscription" +description: |- + Provides a resource to manage an Infrastructure Performance subscription. +--- + + + +# Resource: aws_vpc_network_performance_metric_subscription + +Provides a resource to manage an Infrastructure Performance subscription. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_network_performance_metric_subscription import VpcNetworkPerformanceMetricSubscription +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcNetworkPerformanceMetricSubscription(self, "example", + destination="us-west-1", + source="us-east-1" + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `destination` - (Required) The target Region or Availability Zone that the metric subscription is enabled for. For example, `eu-west-1`. +* `metric` - (Optional) The metric used for the enabled subscription. Valid values: `aggregate-latency`. Default: `aggregate-latency`. +* `source` - (Required) The source Region or Availability Zone that the metric subscription is enabled for. For example, `us-east-1`. +* `statistic` - (Optional) The statistic used for the enabled subscription. Valid values: `p50`. Default: `p50`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `period` - The data aggregation time for the subscription. + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_peering_connection.html.markdown b/website/docs/cdktf/python/r/vpc_peering_connection.html.markdown new file mode 100644 index 00000000000..2b53db53793 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_peering_connection.html.markdown @@ -0,0 +1,206 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connection" +description: |- + Provides a resource to manage a VPC peering connection. +--- + + + +# Resource: aws_vpc_peering_connection + +Provides a resource to manage a VPC peering connection. + +~> **NOTE on VPC Peering Connections and VPC Peering Connection Options:** Terraform provides +both a standalone [VPC Peering Connection Options](vpc_peering_connection_options.html) and a VPC Peering Connection +resource with `accepter` and `requester` attributes. Do not manage options for the same VPC peering +connection in both a VPC Peering Connection resource and a VPC Peering Connection Options resource. +Doing so will cause a conflict of options and will overwrite the options. +Using a VPC Peering Connection Options resource decouples management of the connection options from +management of the VPC Peering Connection and allows options to be set correctly in cross-account scenarios. + +-> **Note:** For cross-account (requester's AWS account differs from the accepter's AWS account) or inter-region +VPC Peering Connections use the `aws_vpc_peering_connection` resource to manage the requester's side of the +connection and use the `aws_vpc_peering_connection_accepter` resource to manage the accepter's side of the connection. + +-> **Note:** Creating multiple `aws_vpc_peering_connection` resources with the same `peer_vpc_id` and `vpc_id` will not produce an error. Instead, AWS will return the connection `id` that already exists, resulting in multiple `aws_vpc_peering_connection` resources with the same `id`. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_peering_connection import VpcPeeringConnection +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcPeeringConnection(self, "foo", + peer_owner_id=peer_owner_id.string_value, + peer_vpc_id=bar.id, + vpc_id=Token.as_string(aws_vpc_foo.id) + ) +``` + +Basic usage with connection options: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_peering_connection import VpcPeeringConnection +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcPeeringConnection(self, "foo", + accepter=VpcPeeringConnectionAccepter( + allow_remote_vpc_dns_resolution=True + ), + peer_owner_id=peer_owner_id.string_value, + peer_vpc_id=bar.id, + requester=VpcPeeringConnectionRequester( + allow_remote_vpc_dns_resolution=True + ), + vpc_id=Token.as_string(aws_vpc_foo.id) + ) +``` + +Basic usage with tags: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc import Vpc +from imports.aws.vpc_peering_connection import VpcPeeringConnection +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + bar = Vpc(self, "bar", + cidr_block="10.2.0.0/16" + ) + foo = Vpc(self, "foo", + cidr_block="10.1.0.0/16" + ) + aws_vpc_peering_connection_foo = VpcPeeringConnection(self, "foo_2", + auto_accept=True, + peer_owner_id=peer_owner_id.string_value, + peer_vpc_id=bar.id, + tags={ + "Name": "VPC Peering between foo and bar" + }, + vpc_id=foo.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_peering_connection_foo.override_logical_id("foo") +``` + +Basic usage with region: + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc import Vpc +from imports.aws.vpc_peering_connection import VpcPeeringConnection +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + bar = Vpc(self, "bar", + cidr_block="10.2.0.0/16", + provider=us_east1 + ) + foo = Vpc(self, "foo", + cidr_block="10.1.0.0/16", + provider=us_west2 + ) + aws_vpc_peering_connection_foo = VpcPeeringConnection(self, "foo_2", + peer_owner_id=peer_owner_id.string_value, + peer_region="us-east-1", + peer_vpc_id=bar.id, + vpc_id=foo.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_peering_connection_foo.override_logical_id("foo") +``` + +## Argument Reference + +-> **Note:** Modifying the VPC Peering Connection options requires peering to be active. An automatic activation +can be done using the [`auto_accept`](vpc_peering_connection.html#auto_accept) attribute. Alternatively, the VPC Peering +Connection has to be made active manually using other means. See [notes](vpc_peering_connection.html#notes) below for +more information. + +The following arguments are supported: + +* `peer_owner_id` - (Optional) The AWS account ID of the owner of the peer VPC. + Defaults to the account ID the [AWS provider][1] is currently connected to. +* `peer_vpc_id` - (Required) The ID of the VPC with which you are creating the VPC Peering Connection. +* `vpc_id` - (Required) The ID of the requester VPC. +* `auto_accept` - (Optional) Accept the peering (both VPCs need to be in the same AWS account and region). +* `peer_region` - (Optional) The region of the accepter VPC of the VPC Peering Connection. `auto_accept` must be `false`, +and use the `aws_vpc_peering_connection_accepter` to manage the accepter side. +* `accepter` (Optional) - An optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that accepts +the peering connection (a maximum of one). +* `requester` (Optional) - A optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requests +the peering connection (a maximum of one). +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +#### Accepter and Requester Arguments + +-> **Note:** When enabled, the DNS resolution feature requires that VPCs participating in the peering +must have support for the DNS hostnames enabled. This can be done using the [`enable_dns_hostnames`](vpc.html#enable_dns_hostnames) attribute in the [`aws_vpc`](vpc.html) resource. See [Using DNS with Your VPC](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html) user guide for more information. + +* `allow_remote_vpc_dns_resolution` - (Optional) Allow a local VPC to resolve public DNS hostnames to +private IP addresses when queried from instances in the peer VPC. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC Peering Connection. +* `accept_status` - The status of the VPC Peering Connection request. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Notes + +If both VPCs are not in the same AWS account and region do not enable the `auto_accept` attribute. +The accepter can manage its side of the connection using the `aws_vpc_peering_connection_accepter` resource +or accept the connection manually using the AWS Management Console, AWS CLI, through SDKs, etc. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `1m`) +- `update` - (Default `1m`) +- `delete` - (Default `1m`) + +## Import + +VPC Peering resources can be imported using the `vpc peering id`, e.g., + +```sh +$ terraform import aws_vpc_peering_connection.test_connection pcx-111aaa111 +``` + +[1]: /docs/providers/aws/index.html + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_peering_connection_accepter.html.markdown b/website/docs/cdktf/python/r/vpc_peering_connection_accepter.html.markdown new file mode 100644 index 00000000000..b31bf169fb9 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_peering_connection_accepter.html.markdown @@ -0,0 +1,152 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connection_accepter" +description: |- + Manage the accepter's side of a VPC Peering Connection. +--- + + + +# Resource: aws_vpc_peering_connection_accepter + +Provides a resource to manage the accepter's side of a VPC Peering Connection. + +When a cross-account (requester's AWS account differs from the accepter's AWS account) or an inter-region +VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the +accepter's account. +The requester can use the `aws_vpc_peering_connection` resource to manage its side of the connection +and the accepter can use the `aws_vpc_peering_connection_accepter` resource to "adopt" its side of the +connection into management. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_caller_identity import DataAwsCallerIdentity +from imports.aws.provider import AwsProvider +from imports.aws.vpc import Vpc +from imports.aws.vpc_peering_connection import VpcPeeringConnection +from imports.aws.vpc_peering_connection_accepter import VpcPeeringConnectionAccepterA +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + AwsProvider(self, "aws", + region="us-east-1" + ) + peer = AwsProvider(self, "aws_1", + alias="peer", + region="us-west-2" + ) + main = Vpc(self, "main", + cidr_block="10.0.0.0/16" + ) + aws_vpc_peer = Vpc(self, "peer", + cidr_block="10.1.0.0/16", + provider=peer + ) + data_aws_caller_identity_peer = DataAwsCallerIdentity(self, "peer_4", + provider=peer + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_aws_caller_identity_peer.override_logical_id("peer") + aws_vpc_peering_connection_peer = VpcPeeringConnection(self, "peer_5", + auto_accept=False, + peer_owner_id=Token.as_string(data_aws_caller_identity_peer.account_id), + peer_region="us-west-2", + peer_vpc_id=Token.as_string(aws_vpc_peer.id), + tags={ + "Side": "Requester" + }, + vpc_id=main.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_peering_connection_peer.override_logical_id("peer") + aws_vpc_peering_connection_accepter_peer = + VpcPeeringConnectionAccepterA(self, "peer_6", + auto_accept=True, + provider=peer, + tags={ + "Side": "Accepter" + }, + vpc_peering_connection_id=Token.as_string(aws_vpc_peering_connection_peer.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_peering_connection_accepter_peer.override_logical_id("peer") +``` + +## Argument Reference + +The following arguments are supported: + +* `vpc_peering_connection_id` - (Required) The VPC Peering Connection ID to manage. +* `auto_accept` - (Optional) Whether or not to accept the peering request. Defaults to `false`. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### Removing `aws_vpc_peering_connection_accepter` from your configuration + +AWS allows a cross-account VPC Peering Connection to be deleted from either the requester's or accepter's side. +However, Terraform only allows the VPC Peering Connection to be deleted from the requester's side +by removing the corresponding `aws_vpc_peering_connection` resource from your configuration. +Removing a `aws_vpc_peering_connection_accepter` resource from your configuration will remove it +from your statefile and management, **but will not destroy the VPC Peering Connection.** + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC Peering Connection. +* `accept_status` - The status of the VPC Peering Connection request. +* `vpc_id` - The ID of the accepter VPC. +* `peer_vpc_id` - The ID of the requester VPC. +* `peer_owner_id` - The AWS account ID of the owner of the requester VPC. +* `peer_region` - The region of the accepter VPC. +* `accepter` - A configuration block that describes [VPC Peering Connection] +(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. +* `requester` - A configuration block that describes [VPC Peering Connection] +(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +#### Accepter and Requester Attributes Reference + +* `allow_remote_vpc_dns_resolution` - Indicates whether a local VPC can resolve public DNS hostnames to +private IP addresses when queried from instances in a peer VPC. + +## Import + +VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g., + +```sh +$ terraform import aws_vpc_peering_connection_accepter.example pcx-12345678 +``` + +Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use [`ignore_changes`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g., + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from cdktf import TerraformResourceLifecycle +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_peering_connection_accepter import VpcPeeringConnectionAccepterA +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name, *, vpcPeeringConnectionId): + super().__init__(scope, name) + VpcPeeringConnectionAccepterA(self, "example", + lifecycle=TerraformResourceLifecycle( + ignore_changes=[auto_accept] + ), + vpc_peering_connection_id=vpc_peering_connection_id + ) +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_peering_connection_options.html.markdown b/website/docs/cdktf/python/r/vpc_peering_connection_options.html.markdown new file mode 100644 index 00000000000..9b7f60d818d --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_peering_connection_options.html.markdown @@ -0,0 +1,174 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connection_options" +description: |- + Provides a resource to manage VPC peering connection options. +--- + + + +# Resource: aws_vpc_peering_connection_options + +Provides a resource to manage VPC peering connection options. + +~> **NOTE on VPC Peering Connections and VPC Peering Connection Options:** Terraform provides +both a standalone VPC Peering Connection Options and a [VPC Peering Connection](vpc_peering_connection.html) +resource with `accepter` and `requester` attributes. Do not manage options for the same VPC peering +connection in both a VPC Peering Connection resource and a VPC Peering Connection Options resource. +Doing so will cause a conflict of options and will overwrite the options. +Using a VPC Peering Connection Options resource decouples management of the connection options from +management of the VPC Peering Connection and allows options to be set correctly in cross-region and +cross-account scenarios. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc import Vpc +from imports.aws.vpc_peering_connection import VpcPeeringConnection +from imports.aws.vpc_peering_connection_options import VpcPeeringConnectionOptions +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + bar = Vpc(self, "bar", + cidr_block="10.1.0.0/16" + ) + foo = Vpc(self, "foo", + cidr_block="10.0.0.0/16" + ) + aws_vpc_peering_connection_foo = VpcPeeringConnection(self, "foo_2", + auto_accept=True, + peer_vpc_id=bar.id, + vpc_id=foo.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_peering_connection_foo.override_logical_id("foo") + aws_vpc_peering_connection_options_foo = VpcPeeringConnectionOptions(self, "foo_3", + accepter=VpcPeeringConnectionOptionsAccepter( + allow_remote_vpc_dns_resolution=True + ), + vpc_peering_connection_id=Token.as_string(aws_vpc_peering_connection_foo.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_peering_connection_options_foo.override_logical_id("foo") +``` + +### Cross-Account Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_caller_identity import DataAwsCallerIdentity +from imports.aws.provider import AwsProvider +from imports.aws.vpc import Vpc +from imports.aws.vpc_peering_connection import VpcPeeringConnection +from imports.aws.vpc_peering_connection_accepter import VpcPeeringConnectionAccepterA +from imports.aws.vpc_peering_connection_options import VpcPeeringConnectionOptions +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + requester = AwsProvider(self, "aws", + alias="requester" + ) + accepter = AwsProvider(self, "aws_1", + alias="accepter" + ) + main = Vpc(self, "main", + cidr_block="10.0.0.0/16", + enable_dns_hostnames=True, + enable_dns_support=True, + provider=requester + ) + peer = Vpc(self, "peer", + cidr_block="10.1.0.0/16", + enable_dns_hostnames=True, + enable_dns_support=True, + provider=accepter + ) + data_aws_caller_identity_peer = DataAwsCallerIdentity(self, "peer_4", + provider=accepter + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_aws_caller_identity_peer.override_logical_id("peer") + aws_vpc_peering_connection_peer = VpcPeeringConnection(self, "peer_5", + auto_accept=False, + peer_owner_id=Token.as_string(data_aws_caller_identity_peer.account_id), + peer_vpc_id=peer.id, + provider=requester, + tags={ + "Side": "Requester" + }, + vpc_id=main.id + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_peering_connection_peer.override_logical_id("peer") + aws_vpc_peering_connection_accepter_peer = + VpcPeeringConnectionAccepterA(self, "peer_6", + auto_accept=True, + provider=accepter, + tags={ + "Side": "Accepter" + }, + vpc_peering_connection_id=Token.as_string(aws_vpc_peering_connection_peer.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpc_peering_connection_accepter_peer.override_logical_id("peer") + VpcPeeringConnectionOptions(self, "accepter", + accepter=VpcPeeringConnectionOptionsAccepter( + allow_remote_vpc_dns_resolution=True + ), + provider=accepter, + vpc_peering_connection_id=Token.as_string(aws_vpc_peering_connection_accepter_peer.id) + ) + VpcPeeringConnectionOptions(self, "requester", + provider=requester, + requester=VpcPeeringConnectionOptionsRequester( + allow_remote_vpc_dns_resolution=True + ), + vpc_peering_connection_id=Token.as_string(aws_vpc_peering_connection_accepter_peer.id) + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `vpc_peering_connection_id` - (Required) The ID of the requester VPC peering connection. +* `accepter` (Optional) - An optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that acceptsthe peering connection (a maximum of one). +* `requester` (Optional) - A optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requeststhe peering connection (a maximum of one). + +#### Accepter and Requester Arguments + +-> **Note:** When enabled, the DNS resolution feature requires that VPCs participating in the peering must have support for the DNS hostnames enabled. This can be done using the [`enable_dns_hostnames`](vpc.html#enable_dns_hostnames) attribute in the [`aws_vpc`](vpc.html) resource. See [Using DNS with Your VPC](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html) user guide for more information. + +* `allow_remote_vpc_dns_resolution` - (Optional) Allow a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC Peering Connection Options. + +## Import + +VPC Peering Connection Options can be imported using the `vpc peering id`, e.g., + +``` +$ terraform import aws_vpc_peering_connection_options.foo pcx-111aaa111 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_security_group_egress_rule.html.markdown b/website/docs/cdktf/python/r/vpc_security_group_egress_rule.html.markdown new file mode 100644 index 00000000000..ea3b8e55257 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_security_group_egress_rule.html.markdown @@ -0,0 +1,76 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_security_group_egress_rule" +description: |- + Provides a VPC security group egress rule resource. +--- + + + +# Resource: aws_vpc_security_group_egress_rule + +Manages an outbound (egress) rule for a security group. + +When specifying an outbound rule for your security group in a VPC, the configuration must include a destination for the traffic. + +~> **NOTE on Security Groups and Security Group Rules:** Terraform currently provides a [Security Group resource](security_group.html) with `ingress` and `egress` rules defined in-line and a [Security Group Rule resource](security_group_rule.html) which manages one or more `ingress` or +`egress` rules. Both of these resource were added before AWS assigned a [security group rule unique ID](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html), and they do not work well in all scenarios using the`description` and `tags` attributes, which rely on the unique ID. +The `aws_vpc_security_group_egress_rule` resource has been added to address these limitations and should be used for all new security group rules. +You should not use the `aws_vpc_security_group_egress_rule` resource in conjunction with an `aws_security_group` resource with in-line rules or with `aws_security_group_rule` resources defined for the same Security Group, as rule conflicts may occur and rules will be overwritten. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_security_group_egress_rule import VpcSecurityGroupEgressRule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcSecurityGroupEgressRule(self, "example", + cidr_ipv4="10.0.0.0/8", + from_port=80, + ip_protocol="tcp", + security_group_id=Token.as_string(aws_security_group_example.id), + to_port=8080 + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `cidr_ipv4` - (Optional) The destination IPv4 CIDR range. +* `cidr_ipv6` - (Optional) The destination IPv6 CIDR range. +* `description` - (Optional) The security group rule description. +* `from_port` - (Optional) The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. +* `ip_protocol` - (Optional) The IP protocol name or number. Use `-1` to specify all protocols. Note that if `ip_protocol` is set to `-1`, it translates to all protocols, all port ranges, and `from_port` and `to_port` values should not be defined. +* `prefix_list_id` - (Optional) The ID of the destination prefix list. +* `referenced_security_group_id` - (Optional) The destination security group that is referenced in the rule. +* `security_group_id` - (Required) The ID of the security group. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `to_port` - (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the security group rule. +* `security_group_rule_id` - The ID of the security group rule. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +Security group egress rules can be imported using the `security_group_rule_id`, e.g., + +``` +$ terraform import aws_vpc_security_group_egress_rule.example sgr-02108b27edd666983 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpc_security_group_ingress_rule.html.markdown b/website/docs/cdktf/python/r/vpc_security_group_ingress_rule.html.markdown new file mode 100644 index 00000000000..bea3bb58980 --- /dev/null +++ b/website/docs/cdktf/python/r/vpc_security_group_ingress_rule.html.markdown @@ -0,0 +1,76 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_security_group_ingress_rule" +description: |- + Provides a VPC security group ingress rule resource. +--- + + + +# Resource: aws_vpc_security_group_ingress_rule + +Manages an inbound (ingress) rule for a security group. + +When specifying an inbound rule for your security group in a VPC, the configuration must include a source for the traffic. + +~> **NOTE on Security Groups and Security Group Rules:** Terraform currently provides a [Security Group resource](security_group.html) with `ingress` and `egress` rules defined in-line and a [Security Group Rule resource](security_group_rule.html) which manages one or more `ingress` or +`egress` rules. Both of these resource were added before AWS assigned a [security group rule unique ID](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html), and they do not work well in all scenarios using the`description` and `tags` attributes, which rely on the unique ID. +The `aws_vpc_security_group_ingress_rule` resource has been added to address these limitations and should be used for all new security group rules. +You should not use the `aws_vpc_security_group_ingress_rule` resource in conjunction with an `aws_security_group` resource with in-line rules or with `aws_security_group_rule` resources defined for the same Security Group, as rule conflicts may occur and rules will be overwritten. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpc_security_group_ingress_rule import VpcSecurityGroupIngressRule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpcSecurityGroupIngressRule(self, "example", + cidr_ipv4="10.0.0.0/8", + from_port=80, + ip_protocol="tcp", + security_group_id=Token.as_string(aws_security_group_example.id), + to_port=8080 + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `cidr_ipv4` - (Optional) The source IPv4 CIDR range. +* `cidr_ipv6` - (Optional) The source IPv6 CIDR range. +* `description` - (Optional) The security group rule description. +* `from_port` - (Optional) The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. +* `ip_protocol` - (Optional) The IP protocol name or number. Use `-1` to specify all protocols. Note that if `ip_protocol` is set to `-1`, it translates to all protocols, all port ranges, and `from_port` and `to_port` values should not be defined. +* `prefix_list_id` - (Optional) The ID of the source prefix list. +* `referenced_security_group_id` - (Optional) The source security group that is referenced in the rule. +* `security_group_id` - (Required) The ID of the security group. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `to_port` - (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the security group rule. +* `security_group_rule_id` - The ID of the security group rule. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +Security group ingress rules can be imported using the `security_group_rule_id`, e.g., + +``` +$ terraform import aws_vpc_security_group_ingress_rule.example sgr-02108b27edd666983 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_access_log_subscription.html.markdown b/website/docs/cdktf/python/r/vpclattice_access_log_subscription.html.markdown new file mode 100644 index 00000000000..d026ec61430 --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_access_log_subscription.html.markdown @@ -0,0 +1,62 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_access_log_subscription" +description: |- + Terraform resource for managing an AWS VPC Lattice Service Network or Services Access log subscription. +--- + + + +# Resource: aws_vpclattice_access_log_subscription + +Terraform resource for managing an AWS VPC Lattice Service Network or Service Access log subscription. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_access_log_subscription import VpclatticeAccessLogSubscription +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeAccessLogSubscription(self, "example", + destination_arn=Token.as_string(bucket.arn), + resource_identifier=Token.as_string(aws_vpclattice_service_network_example.id) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `destination_arn` - (Required) Amazon Resource Name (ARN) of the log destination. +* `resource_identifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service network or service. You must use the ARN if the resources specified in the operation are in different accounts. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the access log subscription. +* `arn` - Amazon Resource Name (ARN) of the access log subscription. +* `resource_identifier` - ID of the service network or service. +* `resource_arn` - Amazon Resource Name (ARN) of the service network or service. +* `destination_arn` - Amazon Resource Name (ARN) of the log destination. + +## Import + +VPC Lattice Access Log Subscription can be imported using the access log subscription ID, e.g., + +``` +$ terraform import aws_vpclattice_access_log_subscription.example rft-8012925589 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_auth_policy.html.markdown b/website/docs/cdktf/python/r/vpclattice_auth_policy.html.markdown new file mode 100644 index 00000000000..fe55fa1d7f6 --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_auth_policy.html.markdown @@ -0,0 +1,90 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_auth_policy" +description: |- + Terraform resource for managing an AWS VPC Lattice Auth Policy. +--- + + + +# Resource: aws_vpclattice_auth_policy + +Terraform resource for managing an AWS VPC Lattice Auth Policy. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_auth_policy import VpclatticeAuthPolicy +from imports.aws.vpclattice_service import VpclatticeService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = VpclatticeService(self, "example", + auth_type="AWS_IAM", + custom_domain_name="example.com", + name="example-vpclattice-service" + ) + aws_vpclattice_auth_policy_example = VpclatticeAuthPolicy(self, "example_1", + policy=Token.as_string( + Fn.jsonencode({ + "Statement": [{ + "Action": "*", + "Condition": { + "StringNotEqualsIgnoreCase": { + "aws:_principal_type": "anonymous" + } + }, + "Effect": "Allow", + "Principal": "*", + "Resource": "*" + } + ], + "Version": "2012-10-17" + })), + resource_identifier=example.arn + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpclattice_auth_policy_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are required: + +* `resource_identifier` - (Required) The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created. +* `policy` - (Required) The auth policy. The policy string in JSON must not contain newlines or blank lines. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `policy` - The auth policy. The policy string in JSON must not contain newlines or blank lines. +* `state` - The state of the auth policy. The auth policy is only active when the auth type is set to AWS_IAM. If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the Auth type is NONE, then, any auth policy you provide will remain inactive. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `60m`) +* `update` - (Default `180m`) +* `delete` - (Default `90m`) + +## Import + +VPC Lattice Auth Policy can be imported using the `example_id_arg`, e.g., + +``` +$ terraform import aws_vpclattice_auth_policy.example rft-8012925589 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_listener.html.markdown b/website/docs/cdktf/python/r/vpclattice_listener.html.markdown new file mode 100644 index 00000000000..5f1bc5420c1 --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_listener.html.markdown @@ -0,0 +1,198 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_listener" +description: |- + Terraform resource for managing an AWS VPC Lattice Listener. +--- + + + +# Resource: aws_vpclattice_listener + +Terraform resource for managing an AWS VPC Lattice Listener. + +## Example Usage + +### Fixed response action + +``` +resource "aws_vpclattice_service" "test" { + name = %[1]q +} + +resource "aws_vpclattice_listener" "test" { + name = %[1]q + protocol = "HTTPS" + service_identifier = aws_vpclattice_service.test.id + default_action { + fixed_response { + status_code = 404 + } + } +} +``` + +### Forward action + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_listener import VpclatticeListener +from imports.aws.vpclattice_service import VpclatticeService +from imports.aws.vpclattice_target_group import VpclatticeTargetGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeService(self, "test", + name="example" + ) + example = VpclatticeTargetGroup(self, "example", + config=VpclatticeTargetGroupConfigA( + port=80, + protocol="HTTP", + vpc_identifier=Token.as_string(aws_vpc_test.id) + ), + name="example-target-group-1", + type="INSTANCE" + ) + aws_vpclattice_listener_example = VpclatticeListener(self, "example_2", + default_action=VpclatticeListenerDefaultAction( + forward=[VpclatticeListenerDefaultActionForward( + target_groups=[VpclatticeListenerDefaultActionForwardTargetGroups( + target_group_identifier=example.id + ) + ] + ) + ] + ), + name="example", + protocol="HTTP", + service_identifier=Token.as_string(aws_vpclattice_service_example.id) + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpclattice_listener_example.override_logical_id("example") +``` + +### Forward action with weighted target groups + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_listener import VpclatticeListener +from imports.aws.vpclattice_service import VpclatticeService +from imports.aws.vpclattice_target_group import VpclatticeTargetGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeService(self, "test", + name="example" + ) + example1 = VpclatticeTargetGroup(self, "example1", + config=VpclatticeTargetGroupConfigA( + port=80, + protocol="HTTP", + vpc_identifier=Token.as_string(aws_vpc_test.id) + ), + name="example-target-group-1", + type="INSTANCE" + ) + example2 = VpclatticeTargetGroup(self, "example2", + config=VpclatticeTargetGroupConfigA( + port=8080, + protocol="HTTP", + vpc_identifier=Token.as_string(aws_vpc_test.id) + ), + name="example-target-group-2", + type="INSTANCE" + ) + VpclatticeListener(self, "example", + default_action=VpclatticeListenerDefaultAction( + forward=[VpclatticeListenerDefaultActionForward( + target_groups=[VpclatticeListenerDefaultActionForwardTargetGroups( + target_group_identifier=example1.id, + weight=80 + ), VpclatticeListenerDefaultActionForwardTargetGroups( + target_group_identifier=example2.id, + weight=20 + ) + ] + ) + ] + ), + name="example", + protocol="HTTP", + service_identifier=Token.as_string(aws_vpclattice_service_example.id) + ) +``` + +## Argument Reference + +The following arguments are supported: + +* `default_action` - (Required) Default action block for the default listener rule. Default action blocks are defined below. +* `name` - (Required, Forces new resource) Name of the listener. A listener name must be unique within a service. Valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen. +* `port` - (Optional, Forces new resource) Listener port. You can specify a value from 1 to 65535. If `port` is not specified and `protocol` is HTTP, the value will default to 80. If `port` is not specified and `protocol` is HTTPS, the value will default to 443. +* `protocol` - (Required, Forces new resource) Protocol for the listener. Supported values are `HTTP` or `HTTPS` +* `service_arn` - (Optional) Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the `service_arn` or `service_identifier` arguments. +* `service_identifier` - (Optional) ID of the VPC Lattice service. You must include either the `service_arn` or `service_identifier` arguments. +-> **NOTE:** You must specify one of the following arguments: `service_arn` or `service_identifier`. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### Default Action + +Default action blocks (for `default_action`) must include at least one of the following argument blocks: + +* `fixed-response` - (Optional) Configuration block for returning a fixed response. See Fixed Response blocks below. +* `forward` - (Optional) Route requests to one or more target groups. See Forward blocks below. + +-> **NOTE:** You must specify exactly one of the following argument blocks: `fixed_response` or `forward`. + +### Fixed Response + +Fixed response blocks (for `fixed-response`) must include the following argument: + +* `status_code` - (Required) Custom HTTP status code to return, e.g. a 404 response code. See [Listeners](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html) in the AWS documentation for a list of supported codes. + +### Forward + +Forward blocks (for `forward`) must include the following arguments: + +* `target_groups` - (Required) One or more target group blocks. + +### Target Groups + +Target group blocks (for `target_group`) must include the following arguments: + +* `target_group_identifier` - (Required) ID or Amazon Resource Name (ARN) of the target group. +* `weight` - (Optional) Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a +weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See [Listener rules](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) in the AWS documentation for additional examples. Default: `100`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the listener. +* `created_at` - Date and time that the listener was created, specified in ISO-8601 format. +* `listener_id` - Standalone ID of the listener, e.g. `listener-0a1b2c3d4e5f6g`. +* `updated_at` - Date and time that the listener was last updated, specified in ISO-8601 format. + +## Import + +VPC Lattice Listener can be imported by using the `listener_id` of the listener and the `id` of the VPC Lattice service combined with a `/` character, e.g.: + +``` +$ terraform import aws_vpclattice_listener.example svc-1a2b3c4d/listener-987654321 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_listener_rule.html.markdown b/website/docs/cdktf/python/r/vpclattice_listener_rule.html.markdown new file mode 100644 index 00000000000..15925609f0d --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_listener_rule.html.markdown @@ -0,0 +1,190 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_listener_rule" +description: |- + Terraform resource for managing an AWS VPC Lattice Listener Rule. +--- + + + +# Resource: aws_vpclattice_listener_rule + +Terraform resource for managing an AWS VPC Lattice Listener Rule. + +## Example Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_listener_rule import VpclatticeListenerRule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeListenerRule(self, "test", + action=VpclatticeListenerRuleAction( + forward=VpclatticeListenerRuleActionForward( + target_groups=[VpclatticeListenerRuleActionForwardTargetGroups( + target_group_identifier=example.id, + weight=1 + ), VpclatticeListenerRuleActionForwardTargetGroups( + target_group_identifier=example2.id, + weight=2 + ) + ] + ) + ), + listener_identifier=Token.as_string(aws_vpclattice_listener_example.listener_id), + match=VpclatticeListenerRuleMatch( + http_match=VpclatticeListenerRuleMatchHttpMatch( + header_matches=[VpclatticeListenerRuleMatchHttpMatchHeaderMatches( + case_sensitive=False, + match=VpclatticeListenerRuleMatchHttpMatchHeaderMatchesMatch( + exact="example-contains" + ), + name="example-header" + ) + ], + path_match=VpclatticeListenerRuleMatchHttpMatchPathMatch( + case_sensitive=True, + match=VpclatticeListenerRuleMatchHttpMatchPathMatchMatch( + prefix="/example-path" + ) + ) + ) + ), + name="example", + priority=20, + service_identifier=Token.as_string(aws_vpclattice_service_example.id) + ) +``` + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_listener_rule import VpclatticeListenerRule +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeListenerRule(self, "test", + action=VpclatticeListenerRuleAction( + fixed_response=VpclatticeListenerRuleActionFixedResponse( + status_code=404 + ) + ), + listener_identifier=example.listener_id, + match=VpclatticeListenerRuleMatch( + http_match=VpclatticeListenerRuleMatchHttpMatch( + path_match=VpclatticeListenerRuleMatchHttpMatchPathMatch( + case_sensitive=False, + match=VpclatticeListenerRuleMatchHttpMatchPathMatchMatch( + exact="/example-path" + ) + ) + ) + ), + name="example", + priority=10, + service_identifier=Token.as_string(aws_vpclattice_service_example.id) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `service_identifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service. +* `listener_identifier` - (Required) The ID or Amazon Resource Name (ARN) of the listener. +* `action` - (Required) The action for the default rule. +* `match` - (Required) The rule match. +* `name` - (Required) The name of the rule. The name must be unique within the listener. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen. +* `priority` - (Required) The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority. + +The following arguments are optional: + +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +action (`action`) supports the following: + +* `fixed_response` - (Optional) Describes the rule action that returns a custom HTTP response. +* `forward` - (Optional) The forward action. Traffic that matches the rule is forwarded to the specified target groups. + +fixed response (`fixed_response`) supports the following: + +* `status_code` - (Optional) The HTTP response code. + +forward (`forward`) supports the following: + +* `target_groups` - (Optional) The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic. + +The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group. + +action (`match`) supports the following: + +* `http_match` - (Optional) The HTTP criteria that a rule must match. + +http match (`http_match`) supports the following: + +* `header_matches` - (Optional) The header matches. Matches incoming requests with rule based on request header value before applying rule action. +* `method` - (Optional) The HTTP method type. +* `path_match` - (Optional) The path match. + +header matches (`header_matches`) supports the following: + +* `case_sensitive` - (Optional) Indicates whether the match is case sensitive. Defaults to false. +* `match` - (Optional) The header match type. +* `name` - (Optional) The name of the header. + +header matches match (`match`) supports the following: + +* `contains` - (Optional) Specifies a contains type match. +* `exact` - (Optional) Specifies an exact type match. +* `prefix` - (Optional) Specifies a prefix type match. Matches the value with the prefix. + +path match (`path_match`) supports the following: + +* `case_sensitive` - (Optional) Indicates whether the match is case sensitive. Defaults to false. +* `match` - (Optional) The header match type. + +path match match (`match`) supports the following: + +* `exact` - (Optional) Specifies an exact type match. +* `prefix` - (Optional) Specifies a prefix type match. Matches the value with the prefix. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the target group. +* `rule_id` - Unique identifier for the target group. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `60m`) +* `update` - (Default `180m`) +* `delete` - (Default `90m`) + +## Import + +VPC Lattice Listener Rule can be imported using the `example_id_arg`, e.g., + +``` +$ terraform import aws_vpclattice_listener_rule.example rft-8012925589 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_resource_policy.html.markdown b/website/docs/cdktf/python/r/vpclattice_resource_policy.html.markdown new file mode 100644 index 00000000000..1e7cb7b8df8 --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_resource_policy.html.markdown @@ -0,0 +1,82 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_resource_policy" +description: |- + Terraform resource for managing an AWS VPC Lattice Resource Policy. +--- + + + +# Resource: aws_vpclattice_resource_policy + +Terraform resource for managing an AWS VPC Lattice Resource Policy. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Fn, Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.data_aws_caller_identity import DataAwsCallerIdentity +from imports.aws.data_aws_partition import DataAwsPartition +from imports.aws.vpclattice_resource_policy import VpclatticeResourcePolicy +from imports.aws.vpclattice_service_network import VpclatticeServiceNetwork +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + example = VpclatticeServiceNetwork(self, "example", + name="example-vpclattice-service-network" + ) + current = DataAwsCallerIdentity(self, "current") + data_aws_partition_current = DataAwsPartition(self, "current_2") + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + data_aws_partition_current.override_logical_id("current") + aws_vpclattice_resource_policy_example = VpclatticeResourcePolicy(self, "example_3", + policy=Token.as_string( + Fn.jsonencode({ + "Statement": [{ + "Action": ["vpc-lattice:CreateServiceNetworkVpcAssociation", "vpc-lattice:CreateServiceNetworkServiceAssociation", "vpc-lattice:GetServiceNetwork" + ], + "Effect": "Allow", + "Principal": { + "AWS": "arn:${" + data_aws_partition_current.partition + "}:iam::${" + current.account_id + "}:root" + }, + "Resource": example.arn, + "Sid": "test-pol-principals-6" + } + ], + "Version": "2012-10-17" + })), + resource_arn=example.arn + ) + # This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match. + aws_vpclattice_resource_policy_example.override_logical_id("example") +``` + +## Argument Reference + +The following arguments are required: + +* `resource_arn` - (Required) The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created. +* `policy` - (Required) An IAM policy. The policy string in JSON must not contain newlines or blank lines. + +## Attributes Reference + +No additional attributes are exported. + +## Import + +VPC Lattice Resource Policy can be imported using the `resource_arn`, e.g., + +``` +$ terraform import aws_vpclattice_resource_policy.example rft-8012925589 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_service.html.markdown b/website/docs/cdktf/python/r/vpclattice_service.html.markdown new file mode 100644 index 00000000000..7ee6db9448e --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_service.html.markdown @@ -0,0 +1,76 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service" +description: |- + Terraform resource for managing an AWS VPC Lattice Service. +--- + + + +# Resource: aws_vpclattice_service + +Terraform resource for managing an AWS VPC Lattice Service. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_service import VpclatticeService +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeService(self, "example", + auth_type="AWS_IAM", + custom_domain_name="example.com", + name="example" + ) +``` + +## Argument Reference + +The following arguments are required: + +* `name` - (Required) Name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.Must be between 3 and 40 characters in length. + +The following arguments are optional: + +* `auth_type` - (Optional) Type of IAM policy. Either `NONE` or `AWS_IAM`. +* `certificate_arn` - (Optional) Amazon Resource Name (ARN) of the certificate. +* `custom_domain_name` - (Optional) Custom domain name of the service. +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the service. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information. +* `dns_entry` - Concise description. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information. +* `id` - Unique identifier for the service. +* `status` - Status of the service. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `5m`) +* `delete` - (Default `5m`) + +## Import + +VPC Lattice Service can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_service.example svc-06728e2357ea55f8a +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_service_network.html.markdown b/website/docs/cdktf/python/r/vpclattice_service_network.html.markdown new file mode 100644 index 00000000000..98dbdf8075e --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_service_network.html.markdown @@ -0,0 +1,63 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service_network" +description: |- + Terraform resource for managing an AWS VPC Lattice Service Network. +--- + + + +# Resource: aws_vpclattice_service_network + +Terraform resource for managing an AWS VPC Lattice Service Network. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_service_network import VpclatticeServiceNetwork +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeServiceNetwork(self, "example", + auth_type="AWS_IAM", + name="example" + ) +``` + +## Argument Reference + +The following arguments are required: + +* `name` - (Required) Name of the service network + +The following arguments are optional: + +* `auth_type` - (Optional) Type of IAM policy. Either `NONE` or `AWS_IAM`. +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the Service Network. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Import + +VPC Lattice Service Network can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_service_network.example sn-0158f91c1e3358dba +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_service_network_service_association.html.markdown b/website/docs/cdktf/python/r/vpclattice_service_network_service_association.html.markdown new file mode 100644 index 00000000000..5b4a74dfbcb --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_service_network_service_association.html.markdown @@ -0,0 +1,76 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service_network_service_association" +description: |- + Terraform resource for managing an AWS VPC Lattice Service Network Service Association. +--- + + + +# Resource: aws_vpclattice_service_network_service_association + +Terraform resource for managing an AWS VPC Lattice Service Network Service Association. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_service_network_service_association import VpclatticeServiceNetworkServiceAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeServiceNetworkServiceAssociation(self, "example", + service_identifier=Token.as_string(aws_vpclattice_service_example.id), + service_network_identifier=Token.as_string(aws_vpclattice_service_network_example.id) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `service_identifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service. +* `service_network_identifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. +The following arguments are optional: + +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The ARN of the Association. +* `created_by` - The account that created the association. +* `custom_domain_name` - The custom domain name of the service. +* `dns_entry` - The DNS name of the service. + * `domain_name` - The domain name of the service. + * `hosted_zone_id` - The ID of the hosted zone. +* `id` - The ID of the association. +* `status` - The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `5m`) +* `delete` - (Default `5m`) + +## Import + +VPC Lattice Service Network Service Association can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_service_network_service_association.example snsa-05e2474658a88f6ba +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_service_network_vpc_association.html.markdown b/website/docs/cdktf/python/r/vpclattice_service_network_vpc_association.html.markdown new file mode 100644 index 00000000000..b3b2628e955 --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_service_network_vpc_association.html.markdown @@ -0,0 +1,74 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service_network_vpc_association" +description: |- + Terraform resource for managing an AWS VPC Lattice Service Network VPC Association. +--- + + + +# Resource: aws_vpclattice_service_network_vpc_association + +Terraform resource for managing an AWS VPC Lattice Service Network VPC Association. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_service_network_vpc_association import VpclatticeServiceNetworkVpcAssociation +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeServiceNetworkVpcAssociation(self, "example", + security_group_ids=[Token.as_string(aws_security_group_example.id)], + service_network_identifier=Token.as_string(aws_vpclattice_service_network_example.id), + vpc_identifier=Token.as_string(aws_vpc_example.id) + ) +``` + +## Argument Reference + +The following arguments are required: + +* `vpc_identifier` - (Required) The ID of the VPC. +* `service_network_identifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. +The following arguments are optional: + +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `security_group_ids` - (Optional) The IDs of the security groups. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The ARN of the Association. +* `created_by` - The account that created the association. +* `id` - The ID of the association. +* `status` - The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `5m`) +* `delete` - (Default `5m`) + +## Import + +VPC Lattice Service Network VPC Association can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_service_network_vpc_association.example snsa-05e2474658a88f6ba +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_target_group.html.markdown b/website/docs/cdktf/python/r/vpclattice_target_group.html.markdown new file mode 100644 index 00000000000..2893cdc91df --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_target_group.html.markdown @@ -0,0 +1,163 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_target_group" +description: |- + Terraform resource for managing an AWS VPC Lattice Target Group. +--- + + + +# Resource: aws_vpclattice_target_group + +Terraform resource for managing an AWS VPC Lattice Target Group. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_target_group import VpclatticeTargetGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeTargetGroup(self, "example", + config=VpclatticeTargetGroupConfigA( + port=443, + protocol="HTTPS", + vpc_identifier=Token.as_string(aws_vpc_example.id) + ), + name="example", + type="INSTANCE" + ) +``` + +### Basic usage with Health check + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_target_group import VpclatticeTargetGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeTargetGroup(self, "example", + config=VpclatticeTargetGroupConfigA( + health_check=VpclatticeTargetGroupConfigHealthCheck( + enabled=True, + health_check_interval_seconds=20, + health_check_timeout_seconds=10, + healthy_threshold_count=7, + matcher=VpclatticeTargetGroupConfigHealthCheckMatcher( + value="200-299" + ), + path="/instance", + port=80, + protocol="HTTP", + protocol_version="HTTP1", + unhealthy_threshold_count=3 + ), + port=443, + protocol="HTTPS", + protocol_version="HTTP1", + vpc_identifier=Token.as_string(aws_vpc_example.id) + ), + name="example", + type="ALB" + ) +``` + +### Lambda + +If the type is Lambda, `config` block is not supported. + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_target_group import VpclatticeTargetGroup +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeTargetGroup(self, "example", + name="example", + type="LAMBDA" + ) +``` + +## Argument Reference + +The following arguments are required: + +* `name` - (Required) The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen. +* `type` - (Required) The type of target group. Valid Values are `IP` | `LAMBDA` | `INSTANCE` | `ALB` + +The following arguments are optional: + +* `config` - (Optional) The target group configuration. If type is set to `LAMBDA,` this parameter should not be specified. +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +Config (`config`) supports the following: + +* `health_check` - (Optional) The health check configuration. +* `ip_address_type` - (Optional) The type of IP address used for the target group. Valid values: `IPV4` | `IPV6` +* `port` - (Required) The port on which the targets are listening. +* `protocol` - (Required) The protocol to use for routing traffic to the targets. Valid Values are `HTTP` | `HTTPS` +* `protocol_version` - (Optional) The protocol version. Valid Values are `HTTP1` | `HTTP2` | `GRPC`. Default value is `HTTP1`. +* `vpc_identifier` - (Required) The ID of the VPC. + +Health Check (`health_check`) supports the following: + +* `enabled` - (Optional) Indicates whether health checking is enabled. Defaults to `true`. +* `health_check_interval_seconds` - (Optional) The approximate amount of time, in seconds, between health checks of an individual target. The range is 5–300 seconds. The default is 30 seconds. +* `health_check_timeout_seconds` - (Optional) The amount of time, in seconds, to wait before reporting a target as unhealthy. The range is 1–120 seconds. The default is 5 seconds. +* `healthy_threshold_count ` - (Optional) The number of consecutive successful health checks required before considering an unhealthy target healthy. The range is 2–10. The default is 5. +* `matcher` - (Optional) The codes to use when checking for a successful response from a target. These are called _Success codes_ in the console. + * `value` - (Optional) The HTTP codes to use when checking for a successful response from a target. +* `path` - (Optional) The destination for health checks on the targets. If the protocol version is HTTP/1.1 or HTTP/2, specify a valid URI (for example, /path?query). The default path is `/`. Health checks are not supported if the protocol version is gRPC, however, you can choose HTTP/1.1 or HTTP/2 and specify a valid URI. +* `port` - (Optional) The port used when performing health checks on targets. The default setting is the port that a target receives traffic on. +* `protocol` - (Optional) The protocol used when performing health checks on targets. The possible protocols are `HTTP` and `HTTPS`. +* `protocol_version` - (Optional) The protocol version used when performing health checks on targets. The possible protocol versions are `HTTP1` and `HTTP2`. The default is `HTTP1`. +* `unhealthy_threshold_count` - (Optional) The number of consecutive failed health checks required before considering a target unhealthy. The range is 2–10. The default is 2. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the target group. +* `id` - Unique identifier for the target group. +* `status` - Status of the target group. +* `tags_all` - Map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `5m`) +* `delete` - (Default `5m`) + +## Import + +VPC Lattice Target Group can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_target_group.example tg-0c11d4dc16ed96bdb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/python/r/vpclattice_target_group_attachment.html.markdown b/website/docs/cdktf/python/r/vpclattice_target_group_attachment.html.markdown new file mode 100644 index 00000000000..960204792c8 --- /dev/null +++ b/website/docs/cdktf/python/r/vpclattice_target_group_attachment.html.markdown @@ -0,0 +1,56 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_target_group_attachment" +description: |- + Provides the ability to register a target with an AWS VPC Lattice Target Group. +--- + + + +# Resource: aws_vpclattice_target_group_attachment + +Provides the ability to register a target with an AWS VPC Lattice Target Group. + +## Example Usage + +### Basic Usage + +```python +# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +from constructs import Construct +from cdktf import Token, TerraformStack +# +# Provider bindings are generated by running `cdktf get`. +# See https://cdk.tf/provider-generation for more details. +# +from imports.aws.vpclattice_target_group_attachment import VpclatticeTargetGroupAttachment +class MyConvertedCode(TerraformStack): + def __init__(self, scope, name): + super().__init__(scope, name) + VpclatticeTargetGroupAttachment(self, "example", + target=VpclatticeTargetGroupAttachmentTarget( + id=Token.as_string(aws_lb_example.arn), + port=80 + ), + target_group_identifier=Token.as_string(aws_vpclattice_target_group_example.id) + ) +``` + +## Argument Reference + +The following arguments are required: + +- `target_group_identifier` - (Required) The ID or Amazon Resource Name (ARN) of the target group. +- `target` - (Required) The target. + +`target` supports the following: + +- `id` - (Required) The ID of the target. If the target type of the target group is INSTANCE, this is an instance ID. If the target type is IP , this is an IP address. If the target type is LAMBDA, this is the ARN of the Lambda function. If the target type is ALB, this is the ARN of the Application Load Balancer. +- `port` - (Optional) The port on which the target is listening. For HTTP, the default is 80. For HTTPS, the default is 443. + +## Attributes Reference + +No additional attributes are exported. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_client_vpn_endpoint.html.markdown b/website/docs/cdktf/typescript/d/ec2_client_vpn_endpoint.html.markdown index 95855761c0a..2abe74edef4 100644 --- a/website/docs/cdktf/typescript/d/ec2_client_vpn_endpoint.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_client_vpn_endpoint.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Client VPN endpoint --- + + # Data Source: aws_ec2_client_vpn_endpoint Get information on an EC2 Client VPN endpoint. @@ -15,26 +17,25 @@ Get information on an EC2 Client VPN endpoint. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2ClientVpnEndpoint } from "./.gen/providers/aws/data-aws-ec2-client-vpn-endpoint"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2ClientVpnEndpoint.DataAwsEc2ClientVpnEndpoint( - this, - "example", - { - filter: [ - { - name: "tag:Name", - values: ["ExampleVpn"], - }, - ], - } - ); + new DataAwsEc2ClientVpnEndpoint(this, "example", { + filter: [ + { + name: "tag:Name", + values: ["ExampleVpn"], + }, + ], + }); } } @@ -43,21 +44,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### By Identifier ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2ClientVpnEndpoint } from "./.gen/providers/aws/data-aws-ec2-client-vpn-endpoint"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2ClientVpnEndpoint.DataAwsEc2ClientVpnEndpoint( - this, - "example", - { - clientVpnEndpointId: "cvpn-endpoint-083cf50d6eb314f21", - } - ); + new DataAwsEc2ClientVpnEndpoint(this, "example", { + clientVpnEndpointId: "cvpn-endpoint-083cf50d6eb314f21", + }); } } @@ -108,4 +108,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_coip_pool.html.markdown b/website/docs/cdktf/typescript/d/ec2_coip_pool.html.markdown index aedff5df3de..40a365b9e6a 100644 --- a/website/docs/cdktf/typescript/d/ec2_coip_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_coip_pool.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about a specific EC2 Customer-Owned IP Pool --- + + # Data Source: aws_ec2_coip_pool Provides details about a specific EC2 Customer-Owned IP Pool. @@ -18,12 +20,27 @@ COIP Pool. The following example returns a specific coip pool ID -```terraform -variable "coip_pool_id" {} - -data "aws_ec2_coip_pool" "selected" { - id = var.coip_pool_id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformVariable, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2CoipPool } from "./.gen/providers/aws/data-aws-ec2-coip-pool"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + You can read more about this at https://cdk.tf/variables*/ + const coipPoolId = new TerraformVariable(this, "coip_pool_id", {}); + new DataAwsEc2CoipPool(this, "selected", { + id: coipPoolId.stringValue, + }); + } } + ``` ## Argument Reference @@ -66,4 +83,4 @@ In addition, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_coip_pools.html.markdown b/website/docs/cdktf/typescript/d/ec2_coip_pools.html.markdown index 548b6a0d6dd..b476cb5d3cc 100644 --- a/website/docs/cdktf/typescript/d/ec2_coip_pools.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_coip_pools.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Customer-Owned IP Pools --- + + # Data Source: aws_ec2_coip_pools Provides information for multiple EC2 Customer-Owned IP Pools, such as their identifiers. @@ -14,12 +16,27 @@ Provides information for multiple EC2 Customer-Owned IP Pools, such as their ide The following shows outputting all COIP Pool Ids. -```terraform -data "aws_ec2_coip_pools" "foo" {} - -output "foo" { - value = data.aws_ec2_coip_pools.foo.ids +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2CoipPools } from "./.gen/providers/aws/data-aws-ec2-coip-pools"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const foo = new DataAwsEc2CoipPools(this, "foo", {}); + const cdktfTerraformOutputFoo = new TerraformOutput(this, "foo_1", { + value: foo.ids, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + cdktfTerraformOutputFoo.overrideLogicalId("foo"); + } } + ``` ## Argument Reference @@ -49,4 +66,4 @@ which take the following arguments: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_host.html.markdown b/website/docs/cdktf/typescript/d/ec2_host.html.markdown index ebfe3f56944..2b93aebeacc 100644 --- a/website/docs/cdktf/typescript/d/ec2_host.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_host.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Host. --- + + # Data Source: aws_ec2_host Use this data source to get information about an EC2 Dedicated Host. @@ -13,25 +15,25 @@ Use this data source to get information about an EC2 Dedicated Host. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2Host } from "./.gen/providers/aws/data-aws-ec2-host"; +import { Ec2Host } from "./.gen/providers/aws/ec2-host"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const awsEc2HostTest = new aws.ec2Host.Ec2Host(this, "test", { + const test = new Ec2Host(this, "test", { availabilityZone: "us-west-2a", instanceType: "c5.18xlarge", }); - const dataAwsEc2HostTest = new aws.dataAwsEc2Host.DataAwsEc2Host( - this, - "test_1", - { - hostId: cdktf.Token.asString(awsEc2HostTest.id), - } - ); + const dataAwsEc2HostTest = new DataAwsEc2Host(this, "test_1", { + hostId: test.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataAwsEc2HostTest.overrideLogicalId("test"); } @@ -42,15 +44,18 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Filter Example ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2Host } from "./.gen/providers/aws/data-aws-ec2-host"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2Host.DataAwsEc2Host(this, "test", { + new DataAwsEc2Host(this, "test", { filter: [ { name: "instance-type", @@ -103,4 +108,4 @@ In addition to the attributes above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_instance_type.html.markdown b/website/docs/cdktf/typescript/d/ec2_instance_type.html.markdown index 9628bf7d587..95e3e29cf1b 100644 --- a/website/docs/cdktf/typescript/d/ec2_instance_type.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_instance_type.html.markdown @@ -7,6 +7,8 @@ description: |- --- + + # Data Source: aws_ec2_instance_type Get characteristics for a single EC2 Instance Type. @@ -14,15 +16,18 @@ Get characteristics for a single EC2 Instance Type. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2InstanceType } from "./.gen/providers/aws/data-aws-ec2-instance-type"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2InstanceType.DataAwsEc2InstanceType(this, "example", { + new DataAwsEc2InstanceType(this, "example", { instanceType: "t2.micro", }); } @@ -108,4 +113,4 @@ In addition to the argument above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_instance_type_offering.html.markdown b/website/docs/cdktf/typescript/d/ec2_instance_type_offering.html.markdown index c6603fda8d4..62b279a6406 100644 --- a/website/docs/cdktf/typescript/d/ec2_instance_type_offering.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_instance_type_offering.html.markdown @@ -6,6 +6,8 @@ description: |- Information about single EC2 Instance Type Offering. --- + + # Data Source: aws_ec2_instance_type_offering Information about single EC2 Instance Type Offering. @@ -13,27 +15,26 @@ Information about single EC2 Instance Type Offering. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2InstanceTypeOffering } from "./.gen/providers/aws/data-aws-ec2-instance-type-offering"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2InstanceTypeOffering.DataAwsEc2InstanceTypeOffering( - this, - "example", - { - filter: [ - { - name: "instance-type", - values: ["t2.micro", "t3.micro"], - }, - ], - preferredInstanceTypes: ["t3.micro", "t2.micro"], - } - ); + new DataAwsEc2InstanceTypeOffering(this, "example", { + filter: [ + { + name: "instance-type", + values: ["t2.micro", "t3.micro"], + }, + ], + preferredInstanceTypes: ["t3.micro", "t2.micro"], + }); } } @@ -65,4 +66,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_instance_type_offerings.html.markdown b/website/docs/cdktf/typescript/d/ec2_instance_type_offerings.html.markdown index 63d24b7e9d1..e0edc26503e 100644 --- a/website/docs/cdktf/typescript/d/ec2_instance_type_offerings.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_instance_type_offerings.html.markdown @@ -6,6 +6,8 @@ description: |- Information about EC2 Instance Type Offerings. --- + + # Data Source: aws_ec2_instance_type_offerings Information about EC2 Instance Type Offerings. @@ -13,31 +15,30 @@ Information about EC2 Instance Type Offerings. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2InstanceTypeOfferings } from "./.gen/providers/aws/data-aws-ec2-instance-type-offerings"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2InstanceTypeOfferings.DataAwsEc2InstanceTypeOfferings( - this, - "example", - { - filter: [ - { - name: "instance-type", - values: ["t2.micro", "t3.micro"], - }, - { - name: "location", - values: ["usw2-az4"], - }, - ], - locationType: "availability-zone-id", - } - ); + new DataAwsEc2InstanceTypeOfferings(this, "example", { + filter: [ + { + name: "instance-type", + values: ["t2.micro", "t3.micro"], + }, + { + name: "location", + values: ["usw2-az4"], + }, + ], + locationType: "availability-zone-id", + }); } } @@ -72,4 +73,4 @@ Note that the indexes of Instance Type Offering instance types, locations and lo - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_instance_types.html.markdown b/website/docs/cdktf/typescript/d/ec2_instance_types.html.markdown index bb586ca30ac..b95729406c7 100644 --- a/website/docs/cdktf/typescript/d/ec2_instance_types.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_instance_types.html.markdown @@ -6,6 +6,8 @@ description: |- Information about EC2 Instance Types. --- + + # Data Source: aws_ec2_instance_types Information about EC2 Instance Types. @@ -13,15 +15,18 @@ Information about EC2 Instance Types. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2InstanceTypes } from "./.gen/providers/aws/data-aws-ec2-instance-types"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2InstanceTypes.DataAwsEc2InstanceTypes(this, "test", { + new DataAwsEc2InstanceTypes(this, "test", { filter: [ { name: "auto-recovery-supported", @@ -70,4 +75,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_local_gateway.html.markdown b/website/docs/cdktf/typescript/d/ec2_local_gateway.html.markdown index e88cf56e10e..9cb74a6e239 100644 --- a/website/docs/cdktf/typescript/d/ec2_local_gateway.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_local_gateway.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about an EC2 Local Gateway --- + + # Data Source: aws_ec2_local_gateway Provides details about an EC2 Local Gateway. @@ -15,22 +17,21 @@ Provides details about an EC2 Local Gateway. The following example shows how one might accept a local gateway id as a variable. ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformVariable, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2LocalGateway } from "./.gen/providers/aws/data-aws-ec2-local-gateway"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. You can read more about this at https://cdk.tf/variables*/ - const localGatewayId = new cdktf.TerraformVariable( - this, - "local_gateway_id", - {} - ); - new aws.dataAwsEc2LocalGateway.DataAwsEc2LocalGateway(this, "selected", { + const localGatewayId = new TerraformVariable(this, "local_gateway_id", {}); + new DataAwsEc2LocalGateway(this, "selected", { id: localGatewayId.stringValue, }); } @@ -82,4 +83,4 @@ The following attributes are additionally exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_local_gateway_route_table.html.markdown b/website/docs/cdktf/typescript/d/ec2_local_gateway_route_table.html.markdown index 0d7ff06c103..a38a6cc7b2f 100644 --- a/website/docs/cdktf/typescript/d/ec2_local_gateway_route_table.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_local_gateway_route_table.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about an EC2 Local Gateway Route Table --- + + # Data Source: aws_ec2_local_gateway_route_table Provides details about an EC2 Local Gateway Route Table. @@ -18,28 +20,27 @@ an input variable and needs to, for example, find the associated Outpost or Loca The following example returns a specific local gateway route table ID ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformVariable, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2LocalGatewayRouteTable } from "./.gen/providers/aws/data-aws-ec2-local-gateway-route-table"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. You can read more about this at https://cdk.tf/variables*/ - const awsEc2LocalGatewayRouteTable = new cdktf.TerraformVariable( + const awsEc2LocalGatewayRouteTable = new TerraformVariable( this, "aws_ec2_local_gateway_route_table", {} ); - new aws.dataAwsEc2LocalGatewayRouteTable.DataAwsEc2LocalGatewayRouteTable( - this, - "selected", - { - localGatewayRouteTableId: awsEc2LocalGatewayRouteTable.stringValue, - } - ); + new DataAwsEc2LocalGatewayRouteTable(this, "selected", { + localGatewayRouteTableId: awsEc2LocalGatewayRouteTable.stringValue, + }); } } @@ -77,4 +78,4 @@ which take the following arguments: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_local_gateway_route_tables.html.markdown b/website/docs/cdktf/typescript/d/ec2_local_gateway_route_tables.html.markdown index ebf9a5249d7..ceba3054adf 100644 --- a/website/docs/cdktf/typescript/d/ec2_local_gateway_route_tables.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_local_gateway_route_tables.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Local Gateway Route Tables --- + + # Data Source: aws_ec2_local_gateway_route_tables Provides information for multiple EC2 Local Gateway Route Tables, such as their identifiers. @@ -15,22 +17,20 @@ Provides information for multiple EC2 Local Gateway Route Tables, such as their The following shows outputting all Local Gateway Route Table Ids. ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2LocalGatewayRouteTables } from "./.gen/providers/aws/data-aws-ec2-local-gateway-route-tables"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataAwsEc2LocalGatewayRouteTablesFoo = - new aws.dataAwsEc2LocalGatewayRouteTables.DataAwsEc2LocalGatewayRouteTables( - this, - "foo", - {} - ); - const cdktfTerraformOutputFoo = new cdktf.TerraformOutput(this, "foo_1", { - value: dataAwsEc2LocalGatewayRouteTablesFoo.ids, + const foo = new DataAwsEc2LocalGatewayRouteTables(this, "foo", {}); + const cdktfTerraformOutputFoo = new TerraformOutput(this, "foo_1", { + value: foo.ids, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ cdktfTerraformOutputFoo.overrideLogicalId("foo"); @@ -66,4 +66,4 @@ which take the following arguments: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface.html.markdown b/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface.html.markdown index e03e15d73b0..092a8e610eb 100644 --- a/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface.html.markdown @@ -6,18 +6,42 @@ description: |- Provides details about an EC2 Local Gateway Virtual Interface --- + + # Data Source: aws_ec2_local_gateway_virtual_interface Provides details about an EC2 Local Gateway Virtual Interface. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing). ## Example Usage -```terraform -data "aws_ec2_local_gateway_virtual_interface" "example" { - for_each = data.aws_ec2_local_gateway_virtual_interface_group.example.local_gateway_virtual_interface_ids - - id = each.value +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformIterator, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2LocalGatewayVirtualInterface } from "./.gen/providers/aws/data-aws-ec2-local-gateway-virtual-interface"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const exampleForEachIterator = TerraformIterator.fromList( + Token.asAny( + dataAwsEc2LocalGatewayVirtualInterfaceGroupExample.localGatewayVirtualInterfaceIds + ) + ); + new DataAwsEc2LocalGatewayVirtualInterface(this, "example", { + id: Token.asString(exampleForEachIterator.value), + forEach: exampleForEachIterator, + }); + } } + ``` ## Argument Reference @@ -52,4 +76,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface_group.html.markdown b/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface_group.html.markdown index b8eaa49f856..0852e802c13 100644 --- a/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface_group.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface_group.html.markdown @@ -6,16 +6,32 @@ description: |- Provides details about an EC2 Local Gateway Virtual Interface Group --- + + # Data Source: aws_ec2_local_gateway_virtual_interface_group Provides details about an EC2 Local Gateway Virtual Interface Group. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing). ## Example Usage -```terraform -data "aws_ec2_local_gateway_virtual_interface_group" "example" { - local_gateway_id = data.aws_ec2_local_gateway.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2LocalGatewayVirtualInterfaceGroup } from "./.gen/providers/aws/data-aws-ec2-local-gateway-virtual-interface-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEc2LocalGatewayVirtualInterfaceGroup(this, "example", { + localGatewayId: Token.asString(dataAwsEc2LocalGatewayExample.id), + }); + } } + ``` ## Argument Reference @@ -46,4 +62,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface_groups.html.markdown b/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface_groups.html.markdown index 72a97d90ebf..0485b303200 100644 --- a/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface_groups.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_local_gateway_virtual_interface_groups.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about multiple EC2 Local Gateway Virtual Interface Groups --- + + # Data Source: aws_ec2_local_gateway_virtual_interface_groups Provides details about multiple EC2 Local Gateway Virtual Interface Groups, such as identifiers. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing). @@ -13,19 +15,18 @@ Provides details about multiple EC2 Local Gateway Virtual Interface Groups, such ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2LocalGatewayVirtualInterfaceGroups } from "./.gen/providers/aws/data-aws-ec2-local-gateway-virtual-interface-groups"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2LocalGatewayVirtualInterfaceGroups.DataAwsEc2LocalGatewayVirtualInterfaceGroups( - this, - "all", - {} - ); + new DataAwsEc2LocalGatewayVirtualInterfaceGroups(this, "all", {}); } } @@ -59,4 +60,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_local_gateways.html.markdown b/website/docs/cdktf/typescript/d/ec2_local_gateways.html.markdown index 58e8d79ce11..bf6b64815f7 100644 --- a/website/docs/cdktf/typescript/d/ec2_local_gateways.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_local_gateways.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Local Gateways --- + + # Data Source: aws_ec2_local_gateways Provides information for multiple EC2 Local Gateways, such as their identifiers. @@ -15,22 +17,24 @@ Provides information for multiple EC2 Local Gateways, such as their identifiers. The following example retrieves Local Gateways with a resource tag of `service` set to `production`. ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2LocalGateways } from "./.gen/providers/aws/data-aws-ec2-local-gateways"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataAwsEc2LocalGatewaysFoo = - new aws.dataAwsEc2LocalGateways.DataAwsEc2LocalGateways(this, "foo", { - tags: { - service: "production", - }, - }); - const cdktfTerraformOutputFoo = new cdktf.TerraformOutput(this, "foo_1", { - value: dataAwsEc2LocalGatewaysFoo.ids, + const foo = new DataAwsEc2LocalGateways(this, "foo", { + tags: { + service: "production", + }, + }); + const cdktfTerraformOutputFoo = new TerraformOutput(this, "foo_1", { + value: foo.ids, }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ cdktfTerraformOutputFoo.overrideLogicalId("foo"); @@ -66,4 +70,4 @@ which take the following arguments: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_managed_prefix_list.html.markdown b/website/docs/cdktf/typescript/d/ec2_managed_prefix_list.html.markdown index c33c136869d..af2c52d4249 100644 --- a/website/docs/cdktf/typescript/d/ec2_managed_prefix_list.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_managed_prefix_list.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about a specific managed prefix list --- + + # Data Source: aws_ec2_managed_prefix_list `awsEc2ManagedPrefixList` provides details about a specific AWS prefix list or @@ -16,26 +18,22 @@ customer-managed prefix list in the current region. ### Find the regional DynamoDB prefix list ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2ManagedPrefixList } from "./.gen/providers/aws/data-aws-ec2-managed-prefix-list"; +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataAwsRegionCurrent = new aws.dataAwsRegion.DataAwsRegion( - this, - "current", - {} - ); - new aws.dataAwsEc2ManagedPrefixList.DataAwsEc2ManagedPrefixList( - this, - "example", - { - name: "com.amazonaws.${" + dataAwsRegionCurrent.name + "}.dynamodb", - } - ); + const current = new DataAwsRegion(this, "current", {}); + new DataAwsEc2ManagedPrefixList(this, "example", { + name: "com.amazonaws.${" + current.name + "}.dynamodb", + }); } } @@ -44,26 +42,25 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Find a managed prefix list using filters ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2ManagedPrefixList } from "./.gen/providers/aws/data-aws-ec2-managed-prefix-list"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2ManagedPrefixList.DataAwsEc2ManagedPrefixList( - this, - "example", - { - filter: [ - { - name: "prefix-list-name", - values: ["my-prefix-list"], - }, - ], - } - ); + new DataAwsEc2ManagedPrefixList(this, "example", { + filter: [ + { + name: "prefix-list-name", + values: ["my-prefix-list"], + }, + ], + }); } } @@ -105,4 +102,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_managed_prefix_lists.html.markdown b/website/docs/cdktf/typescript/d/ec2_managed_prefix_lists.html.markdown index e6269fd1ed3..47713987443 100644 --- a/website/docs/cdktf/typescript/d/ec2_managed_prefix_lists.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_managed_prefix_lists.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on managed prefix lists --- + + # Data Source: aws_ec2_managed_prefix_lists This resource can be useful for getting back a list of managed prefix list ids to be referenced elsewhere. @@ -15,45 +17,46 @@ This resource can be useful for getting back a list of managed prefix list ids t The following returns all managed prefix lists filtered by tags ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + Fn, + Token, + TerraformCount, + propertyAccess, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2ManagedPrefixList } from "./.gen/providers/aws/data-aws-ec2-managed-prefix-list"; +import { DataAwsEc2ManagedPrefixLists } from "./.gen/providers/aws/data-aws-ec2-managed-prefix-lists"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataAwsEc2ManagedPrefixListsTestEnv = - new aws.dataAwsEc2ManagedPrefixLists.DataAwsEc2ManagedPrefixLists( - this, - "test_env", - { - tags: { - Env: "test", - }, - } - ); + const testEnv = new DataAwsEc2ManagedPrefixLists(this, "test_env", { + tags: { + Env: "test", + }, + }); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const dataAwsEc2ManagedPrefixListTestEnvCount = cdktf.TerraformCount.of( - cdktf.Fn.lengthOf(dataAwsEc2ManagedPrefixListsTestEnv.ids) + const testEnvCount = TerraformCount.of( + Token.asNumber(Fn.lengthOf(testEnv.ids)) + ); + const dataAwsEc2ManagedPrefixListTestEnv = new DataAwsEc2ManagedPrefixList( + this, + "test_env_1", + { + id: Token.asString( + propertyAccess(Fn.tolist(testEnv.ids), [testEnvCount.index]) + ), + count: testEnvCount, + } ); - const dataAwsEc2ManagedPrefixListTestEnv = - new aws.dataAwsEc2ManagedPrefixList.DataAwsEc2ManagedPrefixList( - this, - "test_env_1", - { - id: cdktf.Token.asString( - cdktf.propertyAccess( - cdktf.Fn.tolist(dataAwsEc2ManagedPrefixListsTestEnv.ids), - [dataAwsEc2ManagedPrefixListTestEnvCount.index] - ) - ), - count: dataAwsEc2ManagedPrefixListTestEnvCount, - } - ); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataAwsEc2ManagedPrefixListTestEnv.overrideLogicalId("test_env"); } @@ -86,4 +89,4 @@ which take the following arguments: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_network_insights_analysis.html.markdown b/website/docs/cdktf/typescript/d/ec2_network_insights_analysis.html.markdown index 5427a4642e4..a2c6b062835 100644 --- a/website/docs/cdktf/typescript/d/ec2_network_insights_analysis.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_network_insights_analysis.html.markdown @@ -6,16 +6,34 @@ description: |- Provides details about a specific Network Insights Analysis. --- + + # Data Source: aws_ec2_network_insights_analysis `awsEc2NetworkInsightsAnalysis` provides details about a specific Network Insights Analysis. ## Example Usage -```terraform -data "aws_ec2_network_insights_analysis" "example" { - network_insights_analysis_id = aws_ec2_network_insights_analysis.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2NetworkInsightsAnalysis } from "./.gen/providers/aws/data-aws-ec2-network-insights-analysis"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEc2NetworkInsightsAnalysis(this, "example", { + networkInsightsAnalysisId: Token.asString( + awsEc2NetworkInsightsAnalysisExample.id + ), + }); + } } + ``` ## Argument Reference @@ -51,4 +69,4 @@ In addition to all arguments above, the following attributes are exported: * `statusMessage` - Message to provide more context when the `status` is `failed`. * `warningMessage` - Warning message. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_network_insights_path.html.markdown b/website/docs/cdktf/typescript/d/ec2_network_insights_path.html.markdown index 31db2845dcc..960426cf86c 100644 --- a/website/docs/cdktf/typescript/d/ec2_network_insights_path.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_network_insights_path.html.markdown @@ -6,16 +6,34 @@ description: |- Provides details about a specific Network Insights Path. --- + + # Data Source: aws_ec2_network_insights_path `awsEc2NetworkInsightsPath` provides details about a specific Network Insights Path. ## Example Usage -```terraform -data "aws_ec2_network_insights_path" "example" { - network_insights_path_id = aws_ec2_network_insights_path.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2NetworkInsightsPath } from "./.gen/providers/aws/data-aws-ec2-network-insights-path"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEc2NetworkInsightsPath(this, "example", { + networkInsightsPathId: Token.asString( + awsEc2NetworkInsightsPathExample.id + ), + }); + } } + ``` ## Argument Reference @@ -47,4 +65,4 @@ In addition to all arguments above, the following attributes are exported: * `sourceIp` - IP address of the AWS resource that is the source of the path. * `tags` - Map of tags assigned to the resource. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_public_ipv4_pool.html.markdown b/website/docs/cdktf/typescript/d/ec2_public_ipv4_pool.html.markdown index c78106e05c8..64f1e067fe7 100644 --- a/website/docs/cdktf/typescript/d/ec2_public_ipv4_pool.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_public_ipv4_pool.html.markdown @@ -6,6 +6,8 @@ description: |- Provides details about a specific AWS EC2 Public IPv4 Pool. --- + + # Data Source: aws_ec2_public_ipv4_pool Provides details about a specific AWS EC2 Public IPv4 Pool. @@ -15,15 +17,18 @@ Provides details about a specific AWS EC2 Public IPv4 Pool. ### Basic Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2PublicIpv4Pool } from "./.gen/providers/aws/data-aws-ec2-public-ipv4-pool"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2PublicIpv4Pool.DataAwsEc2PublicIpv4Pool(this, "example", { + new DataAwsEc2PublicIpv4Pool(this, "example", { poolId: "ipv4pool-ec2-000df99cff0c1ec10", }); } @@ -52,4 +57,4 @@ In addition to all arguments above, the following attributes are exported: * `totalAddressCount` - Total number of addresses in the pool. * `totalAvailableAddressCount` - Total number of available addresses in the pool. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_public_ipv4_pools.html.markdown b/website/docs/cdktf/typescript/d/ec2_public_ipv4_pools.html.markdown index c8b8ea41dd3..c31a10c9b57 100644 --- a/website/docs/cdktf/typescript/d/ec2_public_ipv4_pools.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_public_ipv4_pools.html.markdown @@ -6,6 +6,8 @@ description: |- Terraform data source for getting information about AWS EC2 Public IPv4 Pools. --- + + # Data Source: aws_ec2_public_ipv4_pools Terraform data source for getting information about AWS EC2 Public IPv4 Pools. @@ -15,19 +17,18 @@ Terraform data source for getting information about AWS EC2 Public IPv4 Pools. ### Basic Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2PublicIpv4Pools } from "./.gen/providers/aws/data-aws-ec2-public-ipv4-pools"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2PublicIpv4Pools.DataAwsEc2PublicIpv4Pools( - this, - "example", - {} - ); + new DataAwsEc2PublicIpv4Pools(this, "example", {}); } } @@ -36,26 +37,25 @@ class MyConvertedCode extends cdktf.TerraformStack { ### Usage with Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2PublicIpv4Pools } from "./.gen/providers/aws/data-aws-ec2-public-ipv4-pools"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2PublicIpv4Pools.DataAwsEc2PublicIpv4Pools( - this, - "example", - { - filter: [ - { - name: "tag-key", - values: ["ExampleTagKey"], - }, - ], - } - ); + new DataAwsEc2PublicIpv4Pools(this, "example", { + filter: [ + { + name: "tag-key", + values: ["ExampleTagKey"], + }, + ], + }); } } @@ -78,4 +78,4 @@ which take the following arguments: * `poolIds` - List of all the pool IDs found. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_serial_console_access.html.markdown b/website/docs/cdktf/typescript/d/ec2_serial_console_access.html.markdown index 7e1b7114154..341248b8335 100644 --- a/website/docs/cdktf/typescript/d/ec2_serial_console_access.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_serial_console_access.html.markdown @@ -6,6 +6,8 @@ description: |- Checks whether serial console access is enabled for your AWS account in the current AWS region. --- + + # Data Source: aws_ec2_serial_console_access Provides a way to check whether serial console access is enabled for your AWS account in the current AWS region. @@ -13,19 +15,18 @@ Provides a way to check whether serial console access is enabled for your AWS ac ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2SerialConsoleAccess } from "./.gen/providers/aws/data-aws-ec2-serial-console-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2SerialConsoleAccess.DataAwsEc2SerialConsoleAccess( - this, - "current", - {} - ); + new DataAwsEc2SerialConsoleAccess(this, "current", {}); } } @@ -44,4 +45,4 @@ The following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_spot_price.html.markdown b/website/docs/cdktf/typescript/d/ec2_spot_price.html.markdown index 88c18ff7117..9eb299a0919 100644 --- a/website/docs/cdktf/typescript/d/ec2_spot_price.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_spot_price.html.markdown @@ -6,6 +6,8 @@ description: |- Information about most recent Spot Price for a given EC2 instance. --- + + # Data Source: aws_ec2_spot_price Information about most recent Spot Price for a given EC2 instance. @@ -13,15 +15,18 @@ Information about most recent Spot Price for a given EC2 instance. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2SpotPrice } from "./.gen/providers/aws/data-aws-ec2-spot-price"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2SpotPrice.DataAwsEc2SpotPrice(this, "example", { + new DataAwsEc2SpotPrice(this, "example", { availabilityZone: "us-west-2a", filter: [ { @@ -63,4 +68,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway.html.markdown index b4dfa0c4ff7..1de06305310 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway --- + + # Data Source: aws_ec2_transit_gateway Get information on an EC2 Transit Gateway. @@ -15,15 +17,18 @@ Get information on an EC2 Transit Gateway. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGateway } from "./.gen/providers/aws/data-aws-ec2-transit-gateway"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGateway.DataAwsEc2TransitGateway(this, "example", { + new DataAwsEc2TransitGateway(this, "example", { filter: [ { name: "options.amazon-side-asn", @@ -39,15 +44,18 @@ class MyConvertedCode extends cdktf.TerraformStack { ### By Identifier ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGateway } from "./.gen/providers/aws/data-aws-ec2-transit-gateway"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGateway.DataAwsEc2TransitGateway(this, "example", { + new DataAwsEc2TransitGateway(this, "example", { id: "tgw-12345678", }); } @@ -93,4 +101,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_attachment.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_attachment.html.markdown index c6a362490e8..781551024ca 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_attachment.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_attachment.html.markdown @@ -6,24 +6,41 @@ description: |- Get information on an EC2 Transit Gateway's attachment to a resource --- + + # Data Source: aws_ec2_transit_gateway_attachment Get information on an EC2 Transit Gateway's attachment to a resource. ## Example Usage -```terraform -data "aws_ec2_transit_gateway_attachment" "example" { - filter { - name = "transit-gateway-id" - values = [aws_ec2_transit_gateway.example.id] - } - - filter { - name = "resource-type" - values = ["peering"] +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEc2TransitGatewayAttachment(this, "example", { + filter: [ + { + name: "transit-gateway-id", + values: [Token.asString(awsEc2TransitGatewayExample.id)], + }, + { + name: "resource-type", + values: ["peering"], + }, + ], + }); } } + ``` ## Argument Reference @@ -53,4 +70,4 @@ In addition to all arguments above, the following attributes are exported: * `transitGatewayId` - ID of the transit gateway. * `transitGatewayOwnerId` - The ID of the AWS account that owns the transit gateway. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_attachments.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_attachments.html.markdown index c48843e19d7..499796a0021 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_attachments.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_attachments.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on EC2 Transit Gateway Attachments --- + + # Data Source: aws_ec2_transit_gateway_attachments Get information on EC2 Transit Gateway Attachments. @@ -14,23 +16,51 @@ Get information on EC2 Transit Gateway Attachments. ### By Filter -```hcl -data "aws_ec2_transit_gateway_attachments" "filtered" { - filter { - name = "state" - values = ["pendingAcceptance"] - } - - filter { - name = "resource-type" - values = ["vpc"] +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + Fn, + Token, + TerraformCount, + propertyAccess, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-attachment"; +import { DataAwsEc2TransitGatewayAttachments } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-attachments"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const filtered = new DataAwsEc2TransitGatewayAttachments(this, "filtered", { + filter: [ + { + name: "state", + values: ["pendingAcceptance"], + }, + { + name: "resource-type", + values: ["vpc"], + }, + ], + }); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const unitCount = TerraformCount.of( + Token.asNumber(Fn.lengthOf(filtered.ids)) + ); + new DataAwsEc2TransitGatewayAttachment(this, "unit", { + id: Token.asString(propertyAccess(filtered.ids, [unitCount.index])), + count: unitCount, + }); } } -data "aws_ec2_transit_gateway_attachment" "unit" { - count = length(data.aws_ec2_transit_gateway_attachments.filtered.ids) - id = data.aws_ec2_transit_gateway_attachments.filtered.ids[count.index] -} ``` ## Argument Reference @@ -59,4 +89,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_connect.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_connect.html.markdown index cadcb3d6633..434fdc4048e 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_connect.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_connect.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Connect --- + + # Data Source: aws_ec2_transit_gateway_connect Get information on an EC2 Transit Gateway Connect. @@ -15,26 +17,25 @@ Get information on an EC2 Transit Gateway Connect. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayConnect } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-connect"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayConnect.DataAwsEc2TransitGatewayConnect( - this, - "example", - { - filter: [ - { - name: "transport-transit-gateway-attachment-id", - values: ["tgw-attach-12345678"], - }, - ], - } - ); + new DataAwsEc2TransitGatewayConnect(this, "example", { + filter: [ + { + name: "transport-transit-gateway-attachment-id", + values: ["tgw-attach-12345678"], + }, + ], + }); } } @@ -43,21 +44,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### By Identifier ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayConnect } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-connect"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayConnect.DataAwsEc2TransitGatewayConnect( - this, - "example", - { - transitGatewayConnectId: "tgw-attach-12345678", - } - ); + new DataAwsEc2TransitGatewayConnect(this, "example", { + transitGatewayConnectId: "tgw-attach-12345678", + }); } } @@ -90,4 +90,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_connect_peer.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_connect_peer.html.markdown index 8ea68196119..1587b77af25 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_connect_peer.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_connect_peer.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Connect Peer --- + + # Data Source: aws_ec2_transit_gateway_connect_peer Get information on an EC2 Transit Gateway Connect Peer. @@ -15,26 +17,25 @@ Get information on an EC2 Transit Gateway Connect Peer. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayConnectPeer } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-connect-peer"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayConnectPeer.DataAwsEc2TransitGatewayConnectPeer( - this, - "example", - { - filter: [ - { - name: "transit-gateway-attachment-id", - values: ["tgw-attach-12345678"], - }, - ], - } - ); + new DataAwsEc2TransitGatewayConnectPeer(this, "example", { + filter: [ + { + name: "transit-gateway-attachment-id", + values: ["tgw-attach-12345678"], + }, + ], + }); } } @@ -43,21 +44,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### By Identifier ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayConnectPeer } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-connect-peer"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayConnectPeer.DataAwsEc2TransitGatewayConnectPeer( - this, - "example", - { - transitGatewayConnectPeerId: "tgw-connect-peer-12345678", - } - ); + new DataAwsEc2TransitGatewayConnectPeer(this, "example", { + transitGatewayConnectPeerId: "tgw-connect-peer-12345678", + }); } } @@ -81,6 +81,8 @@ In addition to all arguments above, the following attributes are exported: * `arn` - EC2 Transit Gateway Connect Peer ARN * `bgpAsn` - BGP ASN number assigned customer device +* `bgpPeerAddress` - The IP address assigned to customer device, which is used as BGP IP address. +* `bgpTransitGatewayAddresses` - The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses. * `insideCidrBlocks` - CIDR blocks that will be used for addressing within the tunnel. * `peerAddress` - IP addressed assigned to customer device, which is used as tunnel endpoint * `tags` - Key-value tags for the EC2 Transit Gateway Connect Peer @@ -93,4 +95,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown index 10802b4f9c4..50b08244685 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gateway --- + + # Data Source: aws_ec2_transit_gateway_dx_gateway_attachment Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gateway. @@ -14,11 +16,25 @@ Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gatew ### By Transit Gateway and Direct Connect Gateway Identifiers -```terraform -data "aws_ec2_transit_gateway_dx_gateway_attachment" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id - dx_gateway_id = aws_dx_gateway.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayDxGatewayAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-dx-gateway-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEc2TransitGatewayDxGatewayAttachment(this, "example", { + dxGatewayId: Token.asString(awsDxGatewayExample.id), + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + }); + } } + ``` ## Argument Reference @@ -50,4 +66,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_multicast_domain.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_multicast_domain.html.markdown index 5300c9ae90c..378f52ac1a4 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_multicast_domain.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_multicast_domain.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Multicast Domain --- + + # Data Source: aws_ec2_transit_gateway_multicast_domain Get information on an EC2 Transit Gateway Multicast Domain. @@ -15,26 +17,25 @@ Get information on an EC2 Transit Gateway Multicast Domain. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayMulticastDomain } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-multicast-domain"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayMulticastDomain.DataAwsEc2TransitGatewayMulticastDomain( - this, - "example", - { - filter: [ - { - name: "transit-gateway-multicast-domain-id", - values: ["tgw-mcast-domain-12345678"], - }, - ], - } - ); + new DataAwsEc2TransitGatewayMulticastDomain(this, "example", { + filter: [ + { + name: "transit-gateway-multicast-domain-id", + values: ["tgw-mcast-domain-12345678"], + }, + ], + }); } } @@ -43,21 +44,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### By Identifier ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayMulticastDomain } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-multicast-domain"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayMulticastDomain.DataAwsEc2TransitGatewayMulticastDomain( - this, - "example", - { - transitGatewayMulticastDomainId: "tgw-mcast-domain-12345678", - } - ); + new DataAwsEc2TransitGatewayMulticastDomain(this, "example", { + transitGatewayMulticastDomainId: "tgw-mcast-domain-12345678", + }); } } @@ -107,4 +107,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_peering_attachment.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_peering_attachment.html.markdown index 48906585d84..954c749aa56 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_peering_attachment.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_peering_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Peering Attachment --- + + # Data Source: aws_ec2_transit_gateway_peering_attachment Get information on an EC2 Transit Gateway Peering Attachment. @@ -15,26 +17,25 @@ Get information on an EC2 Transit Gateway Peering Attachment. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayPeeringAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-peering-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayPeeringAttachment.DataAwsEc2TransitGatewayPeeringAttachment( - this, - "example", - { - filter: [ - { - name: "transit-gateway-attachment-id", - values: ["tgw-attach-12345678"], - }, - ], - } - ); + new DataAwsEc2TransitGatewayPeeringAttachment(this, "example", { + filter: [ + { + name: "transit-gateway-attachment-id", + values: ["tgw-attach-12345678"], + }, + ], + }); } } @@ -43,21 +44,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### By Identifier ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayPeeringAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-peering-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayPeeringAttachment.DataAwsEc2TransitGatewayPeeringAttachment( - this, - "attachment", - { - id: "tgw-attach-12345678", - } - ); + new DataAwsEc2TransitGatewayPeeringAttachment(this, "attachment", { + id: "tgw-attach-12345678", + }); } } @@ -95,4 +95,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table.html.markdown index 08b3f7255b2..5b3fcef0fae 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway Route Table --- + + # Data Source: aws_ec2_transit_gateway_route_table Get information on an EC2 Transit Gateway Route Table. @@ -15,30 +17,29 @@ Get information on an EC2 Transit Gateway Route Table. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayRouteTable } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-route-table"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayRouteTable.DataAwsEc2TransitGatewayRouteTable( - this, - "example", - { - filter: [ - { - name: "default-association-route-table", - values: ["true"], - }, - { - name: "transit-gateway-id", - values: ["tgw-12345678"], - }, - ], - } - ); + new DataAwsEc2TransitGatewayRouteTable(this, "example", { + filter: [ + { + name: "default-association-route-table", + values: ["true"], + }, + { + name: "transit-gateway-id", + values: ["tgw-12345678"], + }, + ], + }); } } @@ -47,21 +48,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### By Identifier ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayRouteTable } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-route-table"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayRouteTable.DataAwsEc2TransitGatewayRouteTable( - this, - "example", - { - id: "tgw-rtb-12345678", - } - ); + new DataAwsEc2TransitGatewayRouteTable(this, "example", { + id: "tgw-rtb-12345678", + }); } } @@ -96,4 +96,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table_associations.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table_associations.html.markdown index 962adeaeb85..582b8cdb955 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table_associations.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table_associations.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Transit Gateway Route Table Associations --- + + # Data Source: aws_ec2_transit_gateway_route_table_associations Provides information for multiple EC2 Transit Gateway Route Table Associations, such as their identifiers. @@ -14,10 +16,26 @@ Provides information for multiple EC2 Transit Gateway Route Table Associations, ### By Transit Gateway Identifier -```terraform -data "aws_ec2_transit_gateway_route_table_associations" "example" { - transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayRouteTableAssociations } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-route-table-associations"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEc2TransitGatewayRouteTableAssociations(this, "example", { + transitGatewayRouteTableId: Token.asString( + awsEc2TransitGatewayRouteTableExample.id + ), + }); + } } + ``` ## Argument Reference @@ -46,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - AWS Region. * `ids` - Set of Transit Gateway Route Table Association identifiers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table_propagations.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table_propagations.html.markdown index 1cf37dfd563..8679e45595d 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table_propagations.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_table_propagations.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Transit Gateway Route Table Propagations --- + + # Data Source: aws_ec2_transitgateway_route_table_propagations Provides information for multiple EC2 Transit Gateway Route Table Propagations, such as their identifiers. @@ -14,10 +16,26 @@ Provides information for multiple EC2 Transit Gateway Route Table Propagations, ### By Transit Gateway Identifier -```terraform -data "aws_ec2_transit_gateway_route_table_propagations" "example" { - transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayRouteTablePropagations } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-route-table-propagations"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEc2TransitGatewayRouteTablePropagations(this, "example", { + transitGatewayRouteTableId: Token.asString( + awsEc2TransitGatewayRouteTableExample.id + ), + }); + } } + ``` ## Argument Reference @@ -46,4 +64,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - AWS Region. * `ids` - Set of Transit Gateway Route Table Association identifiers. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_tables.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_tables.html.markdown index 77961c10613..3376b09ca92 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_tables.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_route_tables.html.markdown @@ -6,6 +6,8 @@ description: |- Provides information for multiple EC2 Transit Gateway Route Tables --- + + # Data Source: aws_ec2_transit_gateway_route_tables Provides information for multiple EC2 Transit Gateway Route Tables, such as their identifiers. @@ -14,12 +16,31 @@ Provides information for multiple EC2 Transit Gateway Route Tables, such as thei The following shows outputting all Transit Gateway Route Table Ids. -```terraform -data "aws_ec2_transit_gateway_route_tables" "example" {} - -output "example" { - value = data.aws_ec2_transit_gateway_route_table.example.ids +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayRouteTables } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-route-tables"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new DataAwsEc2TransitGatewayRouteTables( + this, + "example", + {} + ); + const cdktfTerraformOutputExample = new TerraformOutput(this, "example_1", { + value: example.ids, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + cdktfTerraformOutputExample.overrideLogicalId("example"); + } } + ``` ## Argument Reference @@ -53,4 +74,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpc_attachment.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpc_attachment.html.markdown index 22e76d5a21a..207e34f7946 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpc_attachment.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpc_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway VPC Attachment --- + + # Data Source: aws_ec2_transit_gateway_vpc_attachment Get information on an EC2 Transit Gateway VPC Attachment. @@ -15,26 +17,25 @@ Get information on an EC2 Transit Gateway VPC Attachment. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayVpcAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-vpc-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayVpcAttachment.DataAwsEc2TransitGatewayVpcAttachment( - this, - "example", - { - filter: [ - { - name: "vpc-id", - values: ["vpc-12345678"], - }, - ], - } - ); + new DataAwsEc2TransitGatewayVpcAttachment(this, "example", { + filter: [ + { + name: "vpc-id", + values: ["vpc-12345678"], + }, + ], + }); } } @@ -43,21 +44,20 @@ class MyConvertedCode extends cdktf.TerraformStack { ### By Identifier ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayVpcAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-vpc-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayVpcAttachment.DataAwsEc2TransitGatewayVpcAttachment( - this, - "example", - { - id: "tgw-attach-12345678", - } - ); + new DataAwsEc2TransitGatewayVpcAttachment(this, "example", { + id: "tgw-attach-12345678", + }); } } @@ -95,4 +95,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpc_attachments.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpc_attachments.html.markdown index 1d2b67dd3a2..4c22c0955b3 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpc_attachments.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpc_attachments.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on EC2 Transit Gateway VPC Attachments --- + + # Data Source: aws_ec2_transit_gateway_vpc_attachments Get information on EC2 Transit Gateway VPC Attachments. @@ -15,48 +17,47 @@ Get information on EC2 Transit Gateway VPC Attachments. ### By Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + Fn, + Token, + TerraformCount, + propertyAccess, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayVpcAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-vpc-attachment"; +import { DataAwsEc2TransitGatewayVpcAttachments } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-vpc-attachments"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataAwsEc2TransitGatewayVpcAttachmentsFiltered = - new aws.dataAwsEc2TransitGatewayVpcAttachments.DataAwsEc2TransitGatewayVpcAttachments( - this, - "filtered", - { - filter: [ - { - name: "state", - values: ["pendingAcceptance"], - }, - ], - } - ); + const filtered = new DataAwsEc2TransitGatewayVpcAttachments( + this, + "filtered", + { + filter: [ + { + name: "state", + values: ["pendingAcceptance"], + }, + ], + } + ); /*In most cases loops should be handled in the programming language context and not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source you need to keep this like it is.*/ - const dataAwsEc2TransitGatewayVpcAttachmentUnitCount = - cdktf.TerraformCount.of( - cdktf.Fn.lengthOf(dataAwsEc2TransitGatewayVpcAttachmentsFiltered.ids) - ); - new aws.dataAwsEc2TransitGatewayVpcAttachment.DataAwsEc2TransitGatewayVpcAttachment( - this, - "unit", - { - id: cdktf.Token.asString( - cdktf.propertyAccess( - dataAwsEc2TransitGatewayVpcAttachmentsFiltered.ids, - [dataAwsEc2TransitGatewayVpcAttachmentUnitCount.index] - ) - ), - count: dataAwsEc2TransitGatewayVpcAttachmentUnitCount, - } + const unitCount = TerraformCount.of( + Token.asNumber(Fn.lengthOf(filtered.ids)) ); + new DataAwsEc2TransitGatewayVpcAttachment(this, "unit", { + id: Token.asString(propertyAccess(filtered.ids, [unitCount.index])), + count: unitCount, + }); } } @@ -88,4 +89,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpn_attachment.html.markdown b/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpn_attachment.html.markdown index 34ac73fbd3b..fe77c101499 100644 --- a/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpn_attachment.html.markdown +++ b/website/docs/cdktf/typescript/d/ec2_transit_gateway_vpn_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Get information on an EC2 Transit Gateway VPN Attachment --- + + # Data Source: aws_ec2_transit_gateway_vpn_attachment Get information on an EC2 Transit Gateway VPN Attachment. @@ -16,36 +18,49 @@ Get information on an EC2 Transit Gateway VPN Attachment. ### By Transit Gateway and VPN Connection Identifiers -```terraform -data "aws_ec2_transit_gateway_vpn_attachment" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id - vpn_connection_id = aws_vpn_connection.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayVpnAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-vpn-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEc2TransitGatewayVpnAttachment(this, "example", { + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + vpnConnectionId: Token.asString(awsVpnConnectionExample.id), + }); + } } + ``` ### Filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2TransitGatewayVpnAttachment } from "./.gen/providers/aws/data-aws-ec2-transit-gateway-vpn-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.dataAwsEc2TransitGatewayVpnAttachment.DataAwsEc2TransitGatewayVpnAttachment( - this, - "test", - { - filter: [ - { - name: "resource-id", - values: ["some-resource"], - }, - ], - } - ); + new DataAwsEc2TransitGatewayVpnAttachment(this, "test", { + filter: [ + { + name: "resource-id", + values: ["some-resource"], + }, + ], + }); } } @@ -80,4 +95,4 @@ In addition to all arguments above, the following attributes are exported: - `read` - (Default `20M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/eks_addon.html.markdown b/website/docs/cdktf/typescript/d/eks_addon.html.markdown new file mode 100644 index 00000000000..c4498df4438 --- /dev/null +++ b/website/docs/cdktf/typescript/d/eks_addon.html.markdown @@ -0,0 +1,60 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_addon" +description: |- + Retrieve information about an EKS add-on +--- + + + +# Data Source: aws_eks_addon + +Retrieve information about an EKS add-on. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEksAddon } from "./.gen/providers/aws/data-aws-eks-addon"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new TerraformOutput(this, "eks_addon_outputs", { + value: example, + }); + new DataAwsEksAddon(this, "example", { + addonName: "vpc-cni", + clusterName: Token.asString(awsEksClusterExample.name), + }); + } +} + +``` + +## Argument Reference + +* `addonName` – (Required) Name of the EKS add-on. The name must match one of + the names returned by [list-addon](https://docs.aws.amazon.com/cli/latest/reference/eks/list-addons.html). +* `clusterName` – (Required) Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the EKS add-on. +* `addonVersion` - Version of EKS add-on. +* `configurationValues` - Configuration values for the addon with a single JSON string. +* `serviceAccountRoleArn` - ARN of IAM role used for EKS add-on. If value is empty - + then add-on uses the IAM role assigned to the EKS Cluster node. +* `id` - EKS Cluster name and EKS add-on name separated by a colon (`:`). +* `createdAt` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was created. +* `modifiedAt` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was updated. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/eks_addon_version.html.markdown b/website/docs/cdktf/typescript/d/eks_addon_version.html.markdown new file mode 100644 index 00000000000..3d61368609a --- /dev/null +++ b/website/docs/cdktf/typescript/d/eks_addon_version.html.markdown @@ -0,0 +1,73 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_addon_version" +description: |- + Retrieve information about versions of an EKS add-on +--- + + + +# Data Source: aws_eks_addon_version + +Retrieve information about a specific EKS add-on version compatible with an EKS cluster version. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEksAddonVersion } from "./.gen/providers/aws/data-aws-eks-addon-version"; +import { EksAddon } from "./.gen/providers/aws/eks-addon"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const defaultVar = new DataAwsEksAddonVersion(this, "default", { + addonName: "vpc-cni", + kubernetesVersion: example.version, + }); + const latest = new DataAwsEksAddonVersion(this, "latest", { + addonName: "vpc-cni", + kubernetesVersion: example.version, + mostRecent: true, + }); + const cdktfTerraformOutputDefault = new TerraformOutput(this, "default_2", { + value: defaultVar.version, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + cdktfTerraformOutputDefault.overrideLogicalId("default"); + const cdktfTerraformOutputLatest = new TerraformOutput(this, "latest_3", { + value: latest.version, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + cdktfTerraformOutputLatest.overrideLogicalId("latest"); + new EksAddon(this, "vpc_cni", { + addonName: "vpc-cni", + addonVersion: Token.asString(latest.version), + clusterName: example.name, + }); + } +} + +``` + +## Argument Reference + +* `addonName` – (Required) Name of the EKS add-on. The name must match one of + the names returned by [list-addon](https://docs.aws.amazon.com/cli/latest/reference/eks/list-addons.html). +* `kubernetesVersion` – (Required) Version of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). +* `mostRecent` - (Optional) Determines if the most recent or default version of the addon should be returned. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - Name of the add-on +* `version` - Version of the EKS add-on. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/eks_cluster.html.markdown b/website/docs/cdktf/typescript/d/eks_cluster.html.markdown new file mode 100644 index 00000000000..b03dd208f08 --- /dev/null +++ b/website/docs/cdktf/typescript/d/eks_cluster.html.markdown @@ -0,0 +1,86 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_cluster" +description: |- + Retrieve information about an EKS Cluster +--- + + + +# Data Source: aws_eks_cluster + +Retrieve information about an EKS Cluster. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, propertyAccess, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEksCluster } from "./.gen/providers/aws/data-aws-eks-cluster"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new DataAwsEksCluster(this, "example", { + name: "example", + }); + new TerraformOutput(this, "endpoint", { + value: example.endpoint, + }); + new TerraformOutput(this, "identity-oidc-issuer", { + value: propertyAccess(example.identity, ["0", "oidc", "0", "issuer"]), + }); + new TerraformOutput(this, "kubeconfig-certificate-authority-data", { + value: propertyAccess(example.certificateAuthority, ["0", "data"]), + }); + } +} + +``` + +## Argument Reference + +* `name` - (Required) Name of the cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). + +## Attributes Reference + +* `id` - Name of the cluster +* `arn` - ARN of the cluster. +* `certificateAuthority` - Nested attribute containing `certificateAuthorityData` for your cluster. + * `data` - The base64 encoded certificate data required to communicate with your cluster. Add this to the `certificateAuthorityData` section of the `kubeconfig` file for your cluster. +* `clusterId` - The ID of your local Amazon EKS cluster on the AWS Outpost. This attribute isn't available for an AWS EKS cluster on AWS cloud. +* `createdAt` - Unix epoch time stamp in seconds for when the cluster was created. +* `enabledClusterLogTypes` - The enabled control plane logs. +* `endpoint` - Endpoint for your Kubernetes API server. +* `identity` - Nested attribute containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For an example using this information to enable IAM Roles for Service Accounts, see the [`awsEksCluster` resource documentation](/docs/providers/aws/r/eks_cluster.html). + * `oidc` - Nested attribute containing [OpenID Connect](https://openid.net/connect/) identity provider information for the cluster. + * `issuer` - Issuer URL for the OpenID Connect identity provider. +* `kubernetesNetworkConfig` - Nested list containing Kubernetes Network Configuration. + * `ipFamily` - `ipv4` or `ipv6`. + * `serviceIpv4Cidr` - The CIDR block to assign Kubernetes pod and service IP addresses from if `ipv4` was specified when the cluster was created. + * `serviceIpv6Cidr` - The CIDR block to assign Kubernetes pod and service IP addresses from if `ipv6` was specified when the cluster was created. Kubernetes assigns service addresses from the unique local address range (fc00::/7) because you can't specify a custom IPv6 CIDR block when you create the cluster. +* `outpostConfig` - Contains Outpost Configuration. + * `controlPlaneInstanceType` - The Amazon EC2 instance type for all Kubernetes control plane instances. + * `controlPlanePlacement` - An object representing the placement configuration for all the control plane instances of your local Amazon EKS cluster on AWS Outpost. + * `groupName` - The name of the placement group for the Kubernetes control plane instances. + * `outpostArns` - List of ARNs of the Outposts hosting the EKS cluster. Only a single ARN is supported currently. +* `platformVersion` - Platform version for the cluster. +* `roleArn` - ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. +* `status` - Status of the EKS cluster. One of `creating`, `active`, `deleting`, `failed`. +* `tags` - Key-value map of resource tags. +* `version` - Kubernetes server version for the cluster. +* `vpcConfig` - Nested list containing VPC configuration for the cluster. + * `clusterSecurityGroupId` - The cluster security group that was created by Amazon EKS for the cluster. + * `endpointPrivateAccess` - Indicates whether or not the Amazon EKS private API server endpoint is enabled. + * `endpointPublicAccess` - Indicates whether or not the Amazon EKS public API server endpoint is enabled. + * `publicAccessCidrs` - List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint. + * `securityGroupIds` – List of security group IDs + * `subnetIds` – List of subnet IDs + * `vpcId` – The VPC associated with your cluster. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/eks_cluster_auth.html.markdown b/website/docs/cdktf/typescript/d/eks_cluster_auth.html.markdown new file mode 100644 index 00000000000..6ff290bdeb5 --- /dev/null +++ b/website/docs/cdktf/typescript/d/eks_cluster_auth.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_cluster_auth" +description: |- + Get an authentication token to communicate with an EKS Cluster +--- + + + +# Data Source: aws_eks_cluster_auth + +Get an authentication token to communicate with an EKS cluster. + +Uses IAM credentials from the AWS provider to generate a temporary token that is compatible with +[AWS IAM Authenticator](https://github.com/kubernetes-sigs/aws-iam-authenticator) authentication. +This can be used to authenticate to an EKS cluster or to a cluster that has the AWS IAM Authenticator +server configured. + +~> **NOTE:** Dynamically configuring a Terraform Provider via data sources currently has implications on [resource import support](https://github.com/hashicorp/terraform/issues/13018). + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { propertyAccess, Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEksCluster } from "./.gen/providers/aws/data-aws-eks-cluster"; +import { DataAwsEksClusterAuth } from "./.gen/providers/aws/data-aws-eks-cluster-auth"; +import { KubernetesProvider } from "./.gen/providers/kubernetes/provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: kubernetes. + For a more precise conversion please use the --provider flag in convert.*/ + const example = new DataAwsEksCluster(this, "example", { + name: "example", + }); + const dataAwsEksClusterAuthExample = new DataAwsEksClusterAuth( + this, + "example_1", + { + name: "example", + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataAwsEksClusterAuthExample.overrideLogicalId("example"); + new KubernetesProvider(this, "kubernetes", { + cluster_ca_certificate: Fn.base64decode( + Token.asString( + propertyAccess(example.certificateAuthority, ["0", "data"]) + ) + ), + host: example.endpoint, + token: dataAwsEksClusterAuthExample.token, + }); + } +} + +``` + +## Argument Reference + +* `name` - (Required) Name of the cluster + +## Attributes Reference + +* `id` - Name of the cluster. +* `token` - Token to use to authenticate with the cluster. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/eks_clusters.html.markdown b/website/docs/cdktf/typescript/d/eks_clusters.html.markdown new file mode 100644 index 00000000000..6acf8ae3d22 --- /dev/null +++ b/website/docs/cdktf/typescript/d/eks_clusters.html.markdown @@ -0,0 +1,54 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_clusters" +description: |- + Retrieve EKS Clusters list +--- + + + +# Data Source: aws_eks_clusters + +Retrieve EKS Clusters list + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformIterator, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEksCluster } from "./.gen/providers/aws/data-aws-eks-cluster"; +import { DataAwsEksClusters } from "./.gen/providers/aws/data-aws-eks-clusters"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new DataAwsEksClusters(this, "example", {}); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const exampleForEachIterator = TerraformIterator.fromList( + Token.asAny(Fn.toset(example.names)) + ); + const dataAwsEksClusterExample = new DataAwsEksCluster(this, "example_1", { + name: Token.asString(exampleForEachIterator.value), + forEach: exampleForEachIterator, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataAwsEksClusterExample.overrideLogicalId("example"); + } +} + +``` + +## Attributes Reference + +* `id` - AWS Region. +* `names` - Set of EKS clusters names + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/eks_node_group.html.markdown b/website/docs/cdktf/typescript/d/eks_node_group.html.markdown new file mode 100644 index 00000000000..a5da5a46199 --- /dev/null +++ b/website/docs/cdktf/typescript/d/eks_node_group.html.markdown @@ -0,0 +1,78 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_node_group" +description: |- + Retrieve information about an EKS Node Group +--- + + + +# Data Source: aws_eks_node_group + +Retrieve information about an EKS Node Group. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEksNodeGroup } from "./.gen/providers/aws/data-aws-eks-node-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsEksNodeGroup(this, "example", { + clusterName: "example", + nodeGroupName: "example", + }); + } +} + +``` + +## Argument Reference + +* `clusterName` - (Required) Name of the cluster. +* `nodeGroupName` - (Required) Name of the node group. + +## Attributes Reference + +* `id` - EKS Cluster name and EKS Node Group name separated by a colon (`:`). +* `amiType` - Type of Amazon Machine Image (AMI) associated with the EKS Node Group. +* `arn` - ARN of the EKS Node Group. +* `capacityType` - Type of capacity associated with the EKS Node Group. Valid values: `onDemand`, `spot`. +* `diskSize` - Disk size in GiB for worker nodes. +* `instanceTypes` - Set of instance types associated with the EKS Node Group. +* `labels` - Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed. +* `launchTemplate` - Nested attribute containing information about the launch template used to create the EKS Node Group. + * `id` - The ID of the launch template. + * `name` - The name of the launch template. + * `version` - The version number of the launch template. +* `nodeRoleArn` – ARN of the IAM Role that provides permissions for the EKS Node Group. +* `releaseVersion` – AMI version of the EKS Node Group. +* `remoteAccess` - Configuration block with remote access settings. + * `ec2SshKey` - EC2 Key Pair name that provides access for SSH communication with the worker nodes in the EKS Node Group. + * `sourceSecurityGroupIds` - Set of EC2 Security Group IDs to allow SSH access (port 22) from on the worker nodes. +* `resources` - List of objects containing information about underlying resources. + * `autoscalingGroups` - List of objects containing information about AutoScaling Groups. + * `name` - Name of the AutoScaling Group. + * `remoteAccessSecurityGroupId` - Identifier of the remote access EC2 Security Group. +* `scalingConfig` - Configuration block with scaling settings. + * `desiredSize` - Desired number of worker nodes. + * `maxSize` - Maximum number of worker nodes. + * `minSize` - Minimum number of worker nodes. +* `status` - Status of the EKS Node Group. +* `subnetIds` – Identifiers of EC2 Subnets to associate with the EKS Node Group. +* `taints` - List of objects containing information about taints applied to the nodes in the EKS Node Group. + * `key` - The key of the taint. + * `value` - The value of the taint. + * `effect` - The effect of the taint. +* `tags` - Key-value map of resource tags. +* `version` – Kubernetes version. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/eks_node_groups.html.markdown b/website/docs/cdktf/typescript/d/eks_node_groups.html.markdown new file mode 100644 index 00000000000..acf428aea20 --- /dev/null +++ b/website/docs/cdktf/typescript/d/eks_node_groups.html.markdown @@ -0,0 +1,65 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_node_groups" +description: |- + Provides a set of node groups for an EKS Cluster +--- + + + +# Data Source: aws_eks_node_groups + +Retrieve the EKS Node Groups associated with a named EKS cluster. This will allow you to pass a list of Node Group names to other resources. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformIterator, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEksNodeGroup } from "./.gen/providers/aws/data-aws-eks-node-group"; +import { DataAwsEksNodeGroups } from "./.gen/providers/aws/data-aws-eks-node-groups"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new DataAwsEksNodeGroups(this, "example", { + clusterName: "example", + }); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const exampleForEachIterator = TerraformIterator.fromList( + Token.asAny(example.names) + ); + const dataAwsEksNodeGroupExample = new DataAwsEksNodeGroup( + this, + "example_1", + { + clusterName: "example", + nodeGroupName: Token.asString(exampleForEachIterator.value), + forEach: exampleForEachIterator, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataAwsEksNodeGroupExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +* `clusterName` - (Required) Name of the cluster. + +## Attributes Reference + +* `id` - Cluster name. +* `names` - Set of all node group names in an EKS Cluster. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/lambda_alias.html.markdown b/website/docs/cdktf/typescript/d/lambda_alias.html.markdown new file mode 100644 index 00000000000..15eaac6e1ea --- /dev/null +++ b/website/docs/cdktf/typescript/d/lambda_alias.html.markdown @@ -0,0 +1,54 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_alias" +description: |- + Provides a Lambda Alias data source. +--- + + + +# Data Source: aws_lambda_alias + +Provides information about a Lambda Alias. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsLambdaAlias } from "./.gen/providers/aws/data-aws-lambda-alias"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsLambdaAlias(this, "production", { + functionName: "my-lambda-func", + name: "production", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `functionName` - (Required) Name of the aliased Lambda function. +* `name` - (Required) Name of the Lambda alias. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN identifying the Lambda function alias. +* `description` - Description of alias. +* `functionVersion` - Lambda function version which the alias uses. +* `invokeArn` - ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_integration's `uri`. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/lambda_code_signing_config.html.markdown b/website/docs/cdktf/typescript/d/lambda_code_signing_config.html.markdown new file mode 100644 index 00000000000..0f388c913f1 --- /dev/null +++ b/website/docs/cdktf/typescript/d/lambda_code_signing_config.html.markdown @@ -0,0 +1,70 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_code_signing_config" +description: |- + Provides a Lambda Code Signing Config data source. +--- + + + +# Data Source: aws_lambda_code_signing_config + +Provides information about a Lambda Code Signing Config. A code signing configuration defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if deployment validation checks fail). + +For information about Lambda code signing configurations and how to use them, see [configuring code signing for Lambda functions][1] + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsLambdaCodeSigningConfig } from "./.gen/providers/aws/data-aws-lambda-code-signing-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsLambdaCodeSigningConfig(this, "existing_csc", { + arn: + "arn:aws:lambda:${" + + awsRegion.value + + "}:${" + + awsAccount.value + + "}:code-signing-config:csc-0f6c334abcdea4d8b", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `arn` - (Required) ARN of the code signing configuration. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `allowedPublishers` - List of allowed publishers as signing profiles for this code signing configuration. +* `configId` - Unique identifier for the code signing configuration. +* `description` - Code signing configuration description. +* `lastModified` - Date and time that the code signing configuration was last modified. +* `policies` - List of code signing policies that control the validation failure action for signature mismatch or expiry. + +`allowedPublishers` is exported with the following attribute: + +* `signingProfileVersionArns` - The ARN for each of the signing profiles. A signing profile defines a trusted user who can sign a code package. + +`policies` is exported with the following attribute: + +* `untrustedArtifactOnDeployment` - Code signing configuration policy for deployment validation failure. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/lambda_function.html.markdown b/website/docs/cdktf/typescript/d/lambda_function.html.markdown new file mode 100644 index 00000000000..5f40d9ce902 --- /dev/null +++ b/website/docs/cdktf/typescript/d/lambda_function.html.markdown @@ -0,0 +1,82 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function" +description: |- + Provides a Lambda Function data source. +--- + + + +# aws_lambda_function + +Provides information about a Lambda Function. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { VariableType, TerraformVariable, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsLambdaFunction } from "./.gen/providers/aws/data-aws-lambda-function"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + You can read more about this at https://cdk.tf/variables*/ + const functionName = new TerraformVariable(this, "function_name", { + type: VariableType.STRING, + }); + new DataAwsLambdaFunction(this, "existing", { + functionName: functionName.stringValue, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `functionName` - (Required) Name of the lambda function. +* `qualifier` - (Optional) Alias name or version number of the lambda functionE.g., `$latest`, `myAlias`, or `1`. When not included: the data source resolves to the most recent published version; if no published version exists: it resolves to the most recent unpublished version. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `architectures` - Instruction set architecture for the Lambda function. +* `arn` - Unqualified (no `:qualifier` or `:version` suffix) ARN identifying your Lambda Function. See also `qualifiedArn`. +* `codeSigningConfigArn` - ARN for a Code Signing Configuration. +* `deadLetterConfig` - Configure the function's *dead letter queue*. +* `description` - Description of what your Lambda Function does. +* `environment` - Lambda environment's configuration settings. +* `ephemeralStorage` - Amount of Ephemeral storage(`/tmp`) allocated for the Lambda Function. +* `fileSystemConfig` - Connection settings for an Amazon EFS file system. +* `handler` - Function entrypoint in your code. +* `imageUri` - URI of the container image. +* `invokeArn` - ARN to be used for invoking Lambda Function from API Gateway. **NOTE:** Starting with `v4510` of the provider, this will *not* include the qualifier. +* `kmsKeyArn` - ARN for the KMS encryption key. +* `lastModified` - Date this resource was last modified. +* `layers` - List of Lambda Layer ARNs attached to your Lambda Function. +* `memorySize` - Amount of memory in MB your Lambda Function can use at runtime. +* `qualifiedArn` - Qualified (`:qualifier` or `:version` suffix) ARN identifying your Lambda Function. See also `arn`. +* `qualifiedInvokeArn` - Qualified (`:qualifier` or `:version` suffix) ARN to be used for invoking Lambda Function from API Gateway. See also `invokeArn`. +* `reservedConcurrentExecutions` - The amount of reserved concurrent executions for this lambda function or `1` if unreserved. +* `role` - IAM role attached to the Lambda Function. +* `runtime` - Runtime environment for the Lambda function. +* `signingJobArn` - ARN of a signing job. +* `signingProfileVersionArn` - The ARN for a signing profile version. +* `sourceCodeHash` - Base64-encoded representation of raw SHA-256 sum of the zip file. +* `sourceCodeSize` - Size in bytes of the function .zip file. +* `timeout` - Function execution time at which Lambda should terminate the function. +* `tracingConfig` - Tracing settings of the function. +* `version` - The version of the Lambda function returned. If `qualifier` is not set, this will resolve to the most recent published version. If no published version of the function exists, `version` will resolve to `$latest`. +* `vpcConfig` - VPC configuration associated with your Lambda function. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/lambda_function_url.html.markdown b/website/docs/cdktf/typescript/d/lambda_function_url.html.markdown new file mode 100644 index 00000000000..1314595a433 --- /dev/null +++ b/website/docs/cdktf/typescript/d/lambda_function_url.html.markdown @@ -0,0 +1,62 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function_url" +description: |- + Provides a Lambda function URL data source. +--- + + + +# aws_lambda_function_url + +Provides information about a Lambda function URL. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { VariableType, TerraformVariable, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsLambdaFunctionUrl } from "./.gen/providers/aws/data-aws-lambda-function-url"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + You can read more about this at https://cdk.tf/variables*/ + const functionName = new TerraformVariable(this, "function_name", { + type: VariableType.STRING, + }); + new DataAwsLambdaFunctionUrl(this, "existing", { + functionName: functionName.stringValue, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `functionName` - (Required) he name (or ARN) of the Lambda function. +* `qualifier` - (Optional) Alias name or `"$latest"`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `authorizationType` - Type of authentication that the function URL uses. +* `cors` - The [cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for the function URL. See the [`awsLambdaFunctionUrl` resource](/docs/providers/aws/r/lambda_function_url.html) documentation for more details. +* `creationTime` - When the function URL was created, in [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime). +* `functionArn` - ARN of the function. +* `functionUrl` - HTTP URL endpoint for the function in the format `https://LambdaUrl.OnAws`. +* `invokeMode` - Whether the Lambda function responds in `buffered` or `responseStream` mode. +* `lastModifiedTime` - When the function URL configuration was last updated, in [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime). +* `urlId` - Generated ID for the endpoint. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/lambda_functions.html.markdown b/website/docs/cdktf/typescript/d/lambda_functions.html.markdown new file mode 100644 index 00000000000..13d01716465 --- /dev/null +++ b/website/docs/cdktf/typescript/d/lambda_functions.html.markdown @@ -0,0 +1,46 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_functions" +description: |- + Terraform data resource to get a list of Lambda Functions. +--- + + + +# aws_lambda_functions + +Terraform data resource to get a list of Lambda Functions. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsLambdaFunctions } from "./.gen/providers/aws/data-aws-lambda-functions"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsLambdaFunctions(this, "all", {}); + } +} + +``` + +## Argument Reference + +The resource does not support any arguments. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `functionNames` - A list of Lambda Function names. +* `functionArns` - A list of Lambda Function ARNs. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/lambda_invocation.html.markdown b/website/docs/cdktf/typescript/d/lambda_invocation.html.markdown new file mode 100644 index 00000000000..b8fc8b9878d --- /dev/null +++ b/website/docs/cdktf/typescript/d/lambda_invocation.html.markdown @@ -0,0 +1,64 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_invocation" +description: |- + Invoke AWS Lambda Function as data source +--- + + + +# Data Source: aws_lambda_invocation + +Use this data source to invoke custom lambda functions as data source. +The lambda function is invoked with [RequestResponse](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) +invocation type. + +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`awsLambdaFunction`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + TerraformOutput, + Fn, + Token, + propertyAccess, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsLambdaInvocation } from "./.gen/providers/aws/data-aws-lambda-invocation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new DataAwsLambdaInvocation(this, "example", { + functionName: lambdaFunctionTest.functionName, + input: '{\n "key1": "value1",\n "key2": "value2"\n}\n\n', + }); + new TerraformOutput(this, "result_entry", { + value: propertyAccess(Fn.jsondecode(Token.asString(example.result)), [ + '"key1"', + ]), + }); + } +} + +``` + +## Argument Reference + +* `functionName` - (Required) Name of the lambda function. +* `input` - (Required) String in JSON format that is passed as payload to the lambda function. +* `qualifier` - (Optional) Qualifier (a.k.a version) of the lambda function. Defaults + to `$latest`. + +## Attributes Reference + +* `result` - String result of the lambda function invocation. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/lambda_layer_version.html.markdown b/website/docs/cdktf/typescript/d/lambda_layer_version.html.markdown new file mode 100644 index 00000000000..e7ca613d9f1 --- /dev/null +++ b/website/docs/cdktf/typescript/d/lambda_layer_version.html.markdown @@ -0,0 +1,71 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_layer_version" +description: |- + Provides a Lambda Layer Version data source. +--- + + + +# aws_lambda_layer_version + +Provides information about a Lambda Layer Version. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { VariableType, TerraformVariable, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsLambdaLayerVersion } from "./.gen/providers/aws/data-aws-lambda-layer-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + You can read more about this at https://cdk.tf/variables*/ + const layerName = new TerraformVariable(this, "layer_name", { + type: VariableType.STRING, + }); + new DataAwsLambdaLayerVersion(this, "existing", { + layerName: layerName.stringValue, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `layerName` - (Required) Name of the lambda layer. +* `version` - (Optional) Specific layer version. Conflicts with `compatibleRuntime` and `compatibleArchitecture`. If omitted, the latest available layer version will be used. +* `compatibleRuntime` (Optional) Specific runtime the layer version must support. Conflicts with `version`. If specified, the latest available layer version supporting the provided runtime will be used. +* `compatibleArchitecture` (Optional) Specific architecture the layer version could support. Conflicts with `version`. If specified, the latest available layer version supporting the provided architecture will be used. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `description` - Description of the specific Lambda Layer version. +* `licenseInfo` - License info associated with the specific Lambda Layer version. +* `compatibleRuntimes` - List of [Runtimes][1] the specific Lambda Layer version is compatible with. +* `compatibleArchitectures` - A list of [Architectures][2] the specific Lambda Layer version is compatible with. +* `arn` - ARN of the Lambda Layer with version. +* `layerArn` - ARN of the Lambda Layer without version. +* `createdDate` - Date this resource was created. +* `signingJobArn` - ARN of a signing job. +* `signingProfileVersionArn` - The ARN for a signing profile version. +* `sourceCodeHash` - Base64-encoded representation of raw SHA-256 sum of the zip file. +* `sourceCodeSize` - Size in bytes of the function .zip file. +* `version` - This Lamba Layer version. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersion.html#SSS-GetLayerVersion-response-CompatibleRuntimes +[2]: https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersion.html#SSS-GetLayerVersion-response-CompatibleArchitectures + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc.html.markdown b/website/docs/cdktf/typescript/d/vpc.html.markdown new file mode 100644 index 00000000000..9fc784e05b6 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc.html.markdown @@ -0,0 +1,120 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc" +description: |- + Provides details about a specific VPC +--- + + + +# Data Source: aws_vpc + +`awsVpc` provides details about a specific VPC. + +This resource can prove useful when a module accepts a vpc id as +an input variable and needs to, for example, determine the CIDR block of that +VPC. + +## Example Usage + +The following example shows how one might accept a VPC id as a variable +and use this data source to obtain the data necessary to create a subnet +within it. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformVariable, Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpc } from "./.gen/providers/aws/data-aws-vpc"; +import { Subnet } from "./.gen/providers/aws/subnet"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + You can read more about this at https://cdk.tf/variables*/ + const vpcId = new TerraformVariable(this, "vpc_id", {}); + const selected = new DataAwsVpc(this, "selected", { + id: vpcId.stringValue, + }); + new Subnet(this, "example", { + availabilityZone: "us-west-2a", + cidrBlock: Token.asString( + Fn.cidrsubnet(Token.asString(selected.cidrBlock), 4, 1) + ), + vpcId: Token.asString(selected.id), + }); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +VPCs in the current region. The given filters must match exactly one +VPC whose data will be exported as attributes. + +* `cidrBlock` - (Optional) Cidr block of the desired VPC. + +* `dhcpOptionsId` - (Optional) DHCP options id of the desired VPC. + +* `default` - (Optional) Boolean constraint on whether the desired VPC is + the default VPC for the region. + +* `filter` - (Optional) Custom filter block as described below. + +* `id` - (Optional) ID of the specific VPC to retrieve. + +* `state` - (Optional) Current state of the desired VPC. + Can be either `"pending"` or `"available"`. + +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the desired VPC. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC will be selected if any one of the given values matches. + +## Attributes Reference + +All of the argument attributes except `filter` blocks are also exported as +result attributes. This data source will complete the data by populating +any fields that are not included in the configuration with the data for +the selected VPC. + +The following attribute is additionally exported: + +* `arn` - ARN of VPC +* `enableDnsSupport` - Whether or not the VPC has DNS support +* `enableNetworkAddressUsageMetrics` - Whether Network Address Usage metrics are enabled for your VPC +* `enableDnsHostnames` - Whether or not the VPC has DNS hostname support +* `instanceTenancy` - Allowed tenancy of instances launched into the + selected VPC. May be any of `"default"`, `"dedicated"`, or `"host"`. +* `ipv6AssociationId` - Association ID for the IPv6 CIDR block. +* `ipv6CidrBlock` - IPv6 CIDR block. +* `mainRouteTableId` - ID of the main route table associated with this VPC. +* `ownerId` - ID of the AWS account that owns the VPC. + +`cidrBlockAssociations` is also exported with the following attributes: + +* `associationId` - Association ID for the IPv4 CIDR block. +* `cidrBlock` - CIDR block for the association. +* `state` - State of the association. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_dhcp_options.html.markdown b/website/docs/cdktf/typescript/d/vpc_dhcp_options.html.markdown new file mode 100644 index 00000000000..ee266a73263 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_dhcp_options.html.markdown @@ -0,0 +1,101 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_dhcp_options" +description: |- + Retrieve information about an EC2 DHCP Options configuration +--- + + + +# Data Source: aws_vpc_dhcp_options + +Retrieve information about an EC2 DHCP Options configuration. + +## Example Usage + +### Lookup by DHCP Options ID + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcDhcpOptions } from "./.gen/providers/aws/data-aws-vpc-dhcp-options"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpcDhcpOptions(this, "example", { + dhcpOptionsId: "dopts-12345678", + }); + } +} + +``` + +### Lookup by Filter + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcDhcpOptions } from "./.gen/providers/aws/data-aws-vpc-dhcp-options"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpcDhcpOptions(this, "example", { + filter: [ + { + name: "key", + values: ["domain-name"], + }, + { + name: "value", + values: ["example.com"], + }, + ], + }); + } +} + +``` + +## Argument Reference + +* `dhcpOptionsId` - (Optional) EC2 DHCP Options ID. +* `filter` - (Optional) List of custom filters as described below. + +### filter + +For more information about filtering, see the [EC2 API documentation](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeDhcpOptions.html). + +* `name` - (Required) Name of the field to filter. +* `values` - (Required) Set of values for filtering. + +## Attributes Reference + +* `arn` - ARN of the DHCP Options Set. +* `dhcpOptionsId` - EC2 DHCP Options ID +* `domainName` - Suffix domain name to used when resolving non Fully Qualified Domain NamesE.g., the `search` value in the `/etc/resolvConf` file. +* `domainNameServers` - List of name servers. +* `id` - EC2 DHCP Options ID +* `netbiosNameServers` - List of NETBIOS name servers. +* `netbiosNodeType` - NetBIOS node type (1, 2, 4, or 8). For more information about these node types, see [RFC 2132](http://www.ietf.org/rfc/rfc2132.txt). +* `ntpServers` - List of NTP servers. +* `tags` - Map of tags assigned to the resource. +* `ownerId` - ID of the AWS account that owns the DHCP options set. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_endpoint.html.markdown b/website/docs/cdktf/typescript/d/vpc_endpoint.html.markdown new file mode 100644 index 00000000000..d0e16aed077 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_endpoint.html.markdown @@ -0,0 +1,94 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint" +description: |- + Provides details about a specific VPC endpoint. +--- + + + +# Data Source: aws_vpc_endpoint + +The VPC Endpoint data source provides details about +a specific VPC endpoint. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcEndpoint } from "./.gen/providers/aws/data-aws-vpc-endpoint"; +import { VpcEndpointRouteTableAssociation } from "./.gen/providers/aws/vpc-endpoint-route-table-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const s3 = new DataAwsVpcEndpoint(this, "s3", { + serviceName: "com.amazonaws.us-west-2.s3", + vpcId: foo.id, + }); + new VpcEndpointRouteTableAssociation(this, "private_s3", { + routeTableId: private.id, + vpcEndpointId: Token.asString(s3.id), + }); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available VPC endpoints. +The given filters must match exactly one VPC endpoint whose data will be exported as attributes. + +* `filter` - (Optional) Custom filter block as described below. +* `id` - (Optional) ID of the specific VPC Endpoint to retrieve. +* `serviceName` - (Optional) Service name of the specific VPC Endpoint to retrieve. For AWS services the service name is usually in the form `comAmazonaws..` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `awsSagemaker.Notebook`). +* `state` - (Optional) State of the specific VPC Endpoint to retrieve. +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the specific VPC Endpoint to retrieve. +* `vpcId` - (Optional) ID of the VPC in which the specific VPC Endpoint is used. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcEndpoints.html). +* `values` - (Required) Set of values that are accepted for the given field. + A VPC Endpoint will be selected if any one of the given values matches. + +## Attributes Reference + +In addition to all arguments above except `filter`, the following attributes are exported: + +* `arn` - ARN of the VPC endpoint. +* `cidrBlocks` - List of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `gateway`. +* `dnsEntry` - DNS entries for the VPC Endpoint. Applicable for endpoints of type `interface`. DNS blocks are documented below. +* `networkInterfaceIds` - One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `interface`. +* `ownerId` - ID of the AWS account that owns the VPC endpoint. +* `policy` - Policy document associated with the VPC Endpoint. Applicable for endpoints of type `gateway`. +* `prefixListId` - Prefix list ID of the exposed AWS service. Applicable for endpoints of type `gateway`. +* `privateDnsEnabled` - Whether or not the VPC is associated with a private hosted zone - `true` or `false`. Applicable for endpoints of type `interface`. +* `requesterManaged` - Whether or not the VPC Endpoint is being managed by its service - `true` or `false`. +* `routeTableIds` - One or more route tables associated with the VPC Endpoint. Applicable for endpoints of type `gateway`. +* `securityGroupIds` - One or more security groups associated with the network interfaces. Applicable for endpoints of type `interface`. +* `subnetIds` - One or more subnets in which the VPC Endpoint is located. Applicable for endpoints of type `interface`. +* `vpcEndpointType` - VPC Endpoint type, `gateway` or `interface`. + +DNS blocks (for `dnsEntry`) support the following attributes: + +* `dnsName` - DNS name. +* `hostedZoneId` - ID of the private hosted zone. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_endpoint_service.html.markdown b/website/docs/cdktf/typescript/d/vpc_endpoint_service.html.markdown new file mode 100644 index 00000000000..21b644362f5 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_endpoint_service.html.markdown @@ -0,0 +1,141 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_service" +description: |- + Provides details about a specific service that can be specified when creating a VPC endpoint. +--- + + + +# Data Source: aws_vpc_endpoint_service + +The VPC Endpoint Service data source details about a specific service that +can be specified when creating a VPC endpoint within the region configured in the provider. + +## Example Usage + +### AWS Service + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcEndpointService } from "./.gen/providers/aws/data-aws-vpc-endpoint-service"; +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcEndpoint } from "./.gen/providers/aws/vpc-endpoint"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const foo = new Vpc(this, "foo", { + cidrBlock: "10.0.0.0/16", + }); + const s3 = new DataAwsVpcEndpointService(this, "s3", { + service: "s3", + serviceType: "Gateway", + }); + new VpcEndpoint(this, "ep", { + serviceName: Token.asString(s3.serviceName), + vpcId: foo.id, + }); + } +} + +``` + +### Non-AWS Service + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcEndpointService } from "./.gen/providers/aws/data-aws-vpc-endpoint-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpcEndpointService(this, "custome", { + serviceName: "com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8", + }); + } +} + +``` + +### Filter + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcEndpointService } from "./.gen/providers/aws/data-aws-vpc-endpoint-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpcEndpointService(this, "test", { + filter: [ + { + name: "service-name", + values: ["some-service"], + }, + ], + }); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available VPC endpoint services. +The given filters must match exactly one VPC endpoint service whose data will be exported as attributes. + +* `filter` - (Optional) Configuration block(s) for filtering. Detailed below. +* `service` - (Optional) Common name of an AWS service (e.g., `s3`). +* `serviceName` - (Optional) Service name that is specified when creating a VPC endpoint. For AWS services the service name is usually in the form `comAmazonaws..` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `awsSagemaker.Notebook`). +* `serviceType` - (Optional) Service type, `gateway` or `interface`. +* `tags` - (Optional) Map of tags, each pair of which must exactly match a pair on the desired VPC Endpoint Service. + +~> **NOTE:** Specifying `service` will not work for non-AWS services or AWS services that don't follow the standard `serviceName` pattern of `comAmazonaws..`. + +### filter Configuration Block + +The following arguments are supported by the `filter` configuration block: + +* `name` - (Required) Name of the filter field. Valid values can be found in the [EC2 DescribeVpcEndpointServices API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcEndpointServices.html). +* `values` - (Required) Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `acceptanceRequired` - Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`. +* `arn` - ARN of the VPC endpoint service. +* `availabilityZones` - Availability Zones in which the service is available. +* `baseEndpointDnsNames` - The DNS names for the service. +* `managesVpcEndpoints` - Whether or not the service manages its VPC endpoints - `true` or `false`. +* `owner` - AWS account ID of the service owner or `amazon`. +* `privateDnsName` - Private DNS name for the service. +* `serviceId` - ID of the endpoint service. +* `supportedIpAddressTypes` - The supported IP address types. +* `tags` - Map of tags assigned to the resource. +* `vpcEndpointPolicySupported` - Whether or not the service supports endpoint policies - `true` or `false`. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_ipam_pool.html.markdown b/website/docs/cdktf/typescript/d/vpc_ipam_pool.html.markdown new file mode 100644 index 00000000000..47531a1217c --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_ipam_pool.html.markdown @@ -0,0 +1,106 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool" +description: |- + Returns details about the first IPAM pool that matches search parameters provided. +--- + + + +# Data Source: aws_vpc_ipam_pool + +`awsVpcIpamPool` provides details about an IPAM pool. + +This resource can prove useful when an ipam pool was created in another root +module and you need the pool's id as an input variable. For example, pools +can be shared via RAM and used to create vpcs with CIDRs from that pool. + +## Example Usage + +The following example shows an account that has only 1 pool, perhaps shared +via RAM, and using that pool id to create a VPC with a CIDR derived from +AWS IPAM. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcIpamPool } from "./.gen/providers/aws/data-aws-vpc-ipam-pool"; +import { Vpc } from "./.gen/providers/aws/vpc"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new DataAwsVpcIpamPool(this, "test", { + filter: [ + { + name: "description", + values: ["*test*"], + }, + { + name: "address-family", + values: ["ipv4"], + }, + ], + }); + const awsVpcTest = new Vpc(this, "test_1", { + ipv4IpamPoolId: Token.asString(test.id), + ipv4NetmaskLength: 28, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcTest.overrideLogicalId("test"); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +VPCs in the current region. The given filters must match exactly one +VPC whose data will be exported as attributes. + +* `ipamPoolId` - (Optional) ID of the IPAM pool you would like information on. +* `filter` - (Optional) Custom filter block as described below. + +### filter + +* `name` - (Required) The name of the filter. Filter names are case-sensitive. +* `values` - (Required) The filter values. Filter values are case-sensitive. + +## Attributes Reference + +All of the argument attributes except `filter` blocks are also exported as +result attributes. This data source will complete the data by populating +any fields that are not included in the configuration with the data for +the selected VPC. + +The following attribute is additionally exported: + +* `addressFamily` - IP protocol assigned to this pool. +* `allocationDefaultNetmaskLength` - A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is `10000/8` and you enter 16 here, new allocations will default to `10000/16`. +* `allocationMaxNetmaskLength` - The maximum netmask length that will be required for CIDR allocations in this pool. +* `allocationMinNetmaskLength` - The minimum netmask length that will be required for CIDR allocations in this pool. +* `allocationResourceTags` - Tags that are required to create resources in using this pool. +* `arn` - ARN of the pool +* `autoImport` - If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. +* `awsService` - Limits which service in AWS that the pool can be used in. `ec2` for example, allows users to use space for Elastic IP addresses and VPCs. +* `description` - Description for the IPAM pool. +* `id` - ID of the IPAM pool. +* `ipamScopeId` - ID of the scope the pool belongs to. +* `locale` - Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. +* `publiclyAdvertisable` - Defines whether or not IPv6 pool space is publicly advertisable over the internet. +* `sourceIpamPoolId` - ID of the source IPAM pool. +* `tags` - Map of tags to assigned to the resource. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_ipam_pool_cidrs.html.markdown b/website/docs/cdktf/typescript/d/vpc_ipam_pool_cidrs.html.markdown new file mode 100644 index 00000000000..e94b15ddbeb --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_ipam_pool_cidrs.html.markdown @@ -0,0 +1,134 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool_cidrs" +description: |- + Returns cidrs provisioned into an IPAM pool. +--- + + + +# Data Source: aws_vpc_ipam_pool_cidrs + +`awsVpcIpamPoolCidrs` provides details about an IPAM pool. + +This resource can prove useful when an ipam pool was shared to your account and you want to know all (or a filtered list) of the CIDRs that are provisioned into the pool. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcIpamPool } from "./.gen/providers/aws/data-aws-vpc-ipam-pool"; +import { DataAwsVpcIpamPoolCidrs } from "./.gen/providers/aws/data-aws-vpc-ipam-pool-cidrs"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const p = new DataAwsVpcIpamPool(this, "p", { + filter: [ + { + name: "description", + values: ["*mypool*"], + }, + { + name: "address-family", + values: ["ipv4"], + }, + ], + }); + new DataAwsVpcIpamPoolCidrs(this, "c", { + ipamPoolId: Token.asString(p.id), + }); + } +} + +``` + +Filtering: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformIterator, Fn, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcIpamPoolCidrs } from "./.gen/providers/aws/data-aws-vpc-ipam-pool-cidrs"; +import { Ec2ManagedPrefixList } from "./.gen/providers/aws/ec2-managed-prefix-list"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const c = new DataAwsVpcIpamPoolCidrs(this, "c", { + filter: [ + { + name: "cidr", + values: ["10.*"], + }, + ], + ipamPoolId: "ipam-pool-123", + }); + const mycidrs = + "${[ for cidr in ${" + + c.ipamPoolCidrs + + '} : cidr.cidr if cidr.state == "provisioned"]}'; + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const plsDynamicIterator0 = TerraformIterator.fromList( + Token.asAny(mycidrs) + ); + new Ec2ManagedPrefixList(this, "pls", { + addressFamily: "IPv4", + maxEntries: Token.asNumber(Fn.lengthOf(mycidrs)), + name: "IPAM Pool (${" + test.id + "}) Cidrs", + entry: plsDynamicIterator0.dynamic({ + cidr: plsDynamicIterator0.value, + description: plsDynamicIterator0.value, + }), + }); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +VPCs in the current region. The given filters must match exactly one +VPC whose data will be exported as attributes. + +* `ipamPoolId` - ID of the IPAM pool you would like the list of provisioned CIDRs. +* `filter` - Custom filter block as described below. + +## Attributes Reference + +All of the argument attributes except `filter` blocks are also exported as +result attributes. This data source will complete the data by populating +any fields that are not included in the configuration with the data for +the selected IPAM Pool CIDRs. + +The following attribute is additionally exported: + +* `ipamPoolCidrs` - The CIDRs provisioned into the IPAM pool, described below. + +### ipam_pool_cidrs + +* `cidr` - A network CIDR. +* `state` - The provisioning state of that CIDR. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `1M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_ipam_pools.html.markdown b/website/docs/cdktf/typescript/d/vpc_ipam_pools.html.markdown new file mode 100644 index 00000000000..972bdd96dea --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_ipam_pools.html.markdown @@ -0,0 +1,88 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pools" +description: |- + Returns details about IPAM pools that match the search parameters provided. +--- + + + +# Data Source: aws_vpc_ipam_pools + +`awsVpcIpamPools` provides details about IPAM pools. + +This resource can prove useful when IPAM pools are created in another root +module and you need the pool ids as input variables. For example, pools +can be shared via RAM and used to create vpcs with CIDRs from that pool. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcIpamPools } from "./.gen/providers/aws/data-aws-vpc-ipam-pools"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpcIpamPools(this, "test", { + filter: [ + { + name: "description", + values: ["*test*"], + }, + { + name: "address-family", + values: ["ipv4"], + }, + ], + }); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +IPAM Pools in the current region. + +* `filter` - (Required) Custom filter block as described below. + +### filter + +* `name` - (Required) The name of the filter. Filter names are case-sensitive. +* `values` - (Required) The filter values. Filter values are case-sensitive. + +## Attributes Reference + +In addition to all of the arguments above, the following attributes are exported: + +* `ipamPools` - List of IPAM pools and their attributes. See below for details + +### ipam_pools + +The following attributes are available on each pool entry found. + +* `addressFamily` - IP protocol assigned to this pool. +* `allocationDefaultNetmaskLength` - A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is `10000/8` and you enter 16 here, new allocations will default to `10000/16`. +* `allocationMaxNetmaskLength` - The maximum netmask length that will be required for CIDR allocations in this pool. +* `allocationMinNetmaskLength` - The minimum netmask length that will be required for CIDR allocations in this pool. +* `allocationResourceTags` - Tags that are required to create resources in using this pool. +* `arn` - ARN of the pool +* `autoImport` - If enabled, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. +* `awsService` - Limits which service in AWS that the pool can be used in. `ec2` for example, allows users to use space for Elastic IP addresses and VPCs. +* `description` - Description for the IPAM pool. +* `id` - ID of the IPAM pool. +* `ipamScopeId` - ID of the scope the pool belongs to. +* `locale` - Locale is the Region where your pool is available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. +* `publiclyAdvertisable` - Defines whether or not IPv6 pool space is publicly advertisable over the internet. +* `sourceIpamPoolId` - ID of the source IPAM pool. +* `tags` - Map of tags to assigned to the resource. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_ipam_preview_next_cidr.html.markdown b/website/docs/cdktf/typescript/d/vpc_ipam_preview_next_cidr.html.markdown new file mode 100644 index 00000000000..0a5cc7761ec --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_ipam_preview_next_cidr.html.markdown @@ -0,0 +1,78 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_preview_next_cidr" +description: |- + Previews a CIDR from an IPAM address pool. +--- + + + +# Data Source: aws_vpc_ipam_preview_next_cidr + +Previews a CIDR from an IPAM address pool. Only works for private IPv4. + +~> **NOTE:** This functionality is also encapsulated in a resource sharing the same name. The data source can be used when you need to use the cidr in a calculation of the same Root module, `count` for example. However, once a cidr range has been allocated that was previewed, the next refresh will find a **new** cidr and may force new resources downstream. Make sure to use Terraform's lifecycle `ignoreChanges` policy if this is undesirable. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcIpamPreviewNextCidr } from "./.gen/providers/aws/data-aws-vpc-ipam-preview-next-cidr"; +import { VpcIpamPoolCidrAllocation } from "./.gen/providers/aws/vpc-ipam-pool-cidr-allocation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new DataAwsVpcIpamPreviewNextCidr(this, "test", { + dependsOn: [awsVpcIpamPoolCidrTest], + ipamPoolId: Token.asString(awsVpcIpamPoolTest.id), + netmaskLength: 28, + }); + const awsVpcIpamPoolCidrAllocationTest = new VpcIpamPoolCidrAllocation( + this, + "test_1", + { + cidr: Token.asString(test.cidr), + ipamPoolId: Token.asString(awsVpcIpamPoolTest.id), + lifecycle: { + ignoreChanges: [cidr], + }, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrAllocationTest.overrideLogicalId("test"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `disallowedCidrs` - (Optional) Exclude a particular CIDR range from being returned by the pool. +* `ipamPoolId` - (Required) ID of the pool to which you want to assign a CIDR. +* `netmaskLength` - (Optional) Netmask length of the CIDR you would like to preview from the IPAM pool. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `cidr` - Previewed CIDR from the pool. +* `id` - ID of the preview. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_peering_connection.html.markdown b/website/docs/cdktf/typescript/d/vpc_peering_connection.html.markdown new file mode 100644 index 00000000000..f34b83f8479 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_peering_connection.html.markdown @@ -0,0 +1,117 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connection" +description: |- + Provides details about a specific VPC peering connection. +--- + + + +# Data Source: aws_vpc_peering_connection + +The VPC Peering Connection data source provides details about +a specific VPC peering connection. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcPeeringConnection } from "./.gen/providers/aws/data-aws-vpc-peering-connection"; +import { Route } from "./.gen/providers/aws/route"; +import { RouteTable } from "./.gen/providers/aws/route-table"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const rt = new RouteTable(this, "rt", { + vpcId: foo.id, + }); + const pc = new DataAwsVpcPeeringConnection(this, "pc", { + peerCidrBlock: "10.0.1.0/22", + vpcId: foo.id, + }); + new Route(this, "r", { + destinationCidrBlock: Token.asString(pc.peerCidrBlock), + routeTableId: rt.id, + vpcPeeringConnectionId: Token.asString(pc.id), + }); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available VPC peering connection. +The given filters must match exactly one VPC peering connection whose data will be exported as attributes. + +* `id` - (Optional) ID of the specific VPC Peering Connection to retrieve. + +* `status` - (Optional) Status of the specific VPC Peering Connection to retrieve. + +* `vpcId` - (Optional) ID of the requester VPC of the specific VPC Peering Connection to retrieve. + +* `ownerId` - (Optional) AWS account ID of the owner of the requester VPC of the specific VPC Peering Connection to retrieve. + +* `cidrBlock` - (Optional) Primary CIDR block of the requester VPC of the specific VPC Peering Connection to retrieve. + +* `region` - (Optional) Region of the requester VPC of the specific VPC Peering Connection to retrieve. + +* `peerVpcId` - (Optional) ID of the accepter VPC of the specific VPC Peering Connection to retrieve. + +* `peerOwnerId` - (Optional) AWS account ID of the owner of the accepter VPC of the specific VPC Peering Connection to retrieve. + +* `peerCidrBlock` - (Optional) Primary CIDR block of the accepter VPC of the specific VPC Peering Connection to retrieve. + +* `peerRegion` - (Optional) Region of the accepter VPC of the specific VPC Peering Connection to retrieve. + +* `filter` - (Optional) Custom filter block as described below. + +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the desired VPC Peering Connection. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcPeeringConnections.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC Peering Connection will be selected if any one of the given values matches. + +## Attributes Reference + +All of the argument attributes except `filter` are also exported as result attributes. + +* `accepter` - Configuration block that describes [VPC Peering Connection] +(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. + +* `cidrBlockSet` - List of objects with CIDR blocks of the requester VPC. + +* `peerCidrBlockSet` - List of objects with CIDR blocks of the accepter VPC. + +* `requester` - Configuration block that describes [VPC Peering Connection] +(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. + +#### Accepter and Requester Attributes Reference + +* `allowRemoteVpcDnsResolution` - Indicates whether a local VPC can resolve public DNS hostnames to +private IP addresses when queried from instances in a peer VPC. + +#### CIDR block set Attributes Reference + +* `cidrBlock` - CIDR block associated to the VPC of the specific VPC Peering Connection. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_peering_connections.html.markdown b/website/docs/cdktf/typescript/d/vpc_peering_connections.html.markdown new file mode 100644 index 00000000000..0885af8b340 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_peering_connections.html.markdown @@ -0,0 +1,93 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connections" +description: |- + Lists peering connections +--- + + + +# Data Source: aws_vpc_peering_connections + +Use this data source to get IDs of Amazon VPC peering connections +To get more details on each connection, use the data resource [aws_vpc_peering_connection](/docs/providers/aws/d/vpc_peering_connection.html) + +Note: To use this data source in a count, the resources should exist before trying to access +the data source, as noted in [issue 4149](https://github.com/hashicorp/terraform/issues/4149) + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + Fn, + Token, + TerraformCount, + propertyAccess, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcPeeringConnection } from "./.gen/providers/aws/data-aws-vpc-peering-connection"; +import { DataAwsVpcPeeringConnections } from "./.gen/providers/aws/data-aws-vpc-peering-connections"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const pcs = new DataAwsVpcPeeringConnections(this, "pcs", { + filter: [ + { + name: "requester-vpc-info.vpc-id", + values: [foo.id], + }, + ], + }); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const pcCount = TerraformCount.of(Token.asNumber(Fn.lengthOf(pcs.ids))); + new DataAwsVpcPeeringConnection(this, "pc", { + id: Token.asString(propertyAccess(pcs.ids, [pcCount.index])), + count: pcCount, + }); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available VPC peering connections. + +* `filter` - (Optional) Custom filter block as described below. + +* `tags` - (Optional) Mapping of tags, each pair of which must exactly match + a pair on the desired VPC Peering Connection. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcPeeringConnections.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC Peering Connection will be selected if any one of the given values matches. + +## Attributes Reference + +All of the argument attributes except `filter` are also exported as result attributes. + +* `id` - AWS Region. +* `ids` - IDs of the VPC Peering Connections. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_security_group_rule.html.markdown b/website/docs/cdktf/typescript/d/vpc_security_group_rule.html.markdown new file mode 100644 index 00000000000..f8bed9ea1f5 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_security_group_rule.html.markdown @@ -0,0 +1,70 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_security_group_rule" +description: |- + Provides details about a specific security group rule +--- + + + +# Data Source: aws_vpc_security_group_rule + +`awsVpcSecurityGroupRule` provides details about a specific security group rule. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcSecurityGroupRule } from "./.gen/providers/aws/data-aws-vpc-security-group-rule"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpcSecurityGroupRule(this, "example", { + securityGroupRuleId: securityGroupRuleId.stringValue, + }); + } +} + +``` + +## Argument Reference + +The arguments of this data source act as filters for querying the available +security group rules. The given filters must match exactly one security group rule +whose data will be exported as attributes. + +* `securityGroupRuleId` - (Optional) ID of the security group rule to select. +* `filter` - (Optional) Configuration block(s) for filtering. Detailed below. + +### filter Configuration Block + +The following arguments are supported by the `filter` configuration block: + +* `name` - (Required) Name of the filter field. Valid values can be found in the EC2 [`describeSecurityGroupRules`](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroupRules.html) API Reference. +* `values` - (Required) Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the security group rule. +* `cidrIpv4` - The destination IPv4 CIDR range. +* `cidrIpv6` - The destination IPv6 CIDR range. +* `description` - The security group rule description. +* `fromPort` - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. +* `isEgress` - Indicates whether the security group rule is an outbound rule. +* `ipProtocol` - The IP protocol name or number. Use `1` to specify all protocols. +* `prefixListId` - The ID of the destination prefix list. +* `referencedSecurityGroupId` - The destination security group that is referenced in the rule. +* `securityGroupId` - The ID of the security group. +* `tags` - A map of tags assigned to the resource. +* `toPort` - (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpc_security_group_rules.html.markdown b/website/docs/cdktf/typescript/d/vpc_security_group_rules.html.markdown new file mode 100644 index 00000000000..2c4ea90d1b7 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpc_security_group_rules.html.markdown @@ -0,0 +1,60 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_security_group_rules" +description: |- + Get information about a set of security group rules. +--- + + + +# Data Source: aws_vpc_security_group_rules + +This resource can be useful for getting back a set of security group rule IDs. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcSecurityGroupRules } from "./.gen/providers/aws/data-aws-vpc-security-group-rules"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpcSecurityGroupRules(this, "example", { + filter: [ + { + name: "group-id", + values: [securityGroupId.stringValue], + }, + ], + }); + } +} + +``` + +## Argument Reference + +* `filter` - (Optional) Custom filter block as described below. +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the desired security group rule. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroupRules.html). +* `values` - (Required) Set of values that are accepted for the given field. + Security group rule IDs will be selected if any one of the given values match. + +## Attributes Reference + +* `ids` - List of all the security group rule IDs found. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpclattice_auth_policy.html.markdown b/website/docs/cdktf/typescript/d/vpclattice_auth_policy.html.markdown new file mode 100644 index 00000000000..18289319013 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpclattice_auth_policy.html.markdown @@ -0,0 +1,54 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_auth_policy" +description: |- + Terraform data source for managing an AWS VPC Lattice Auth Policy. +--- + + + +# Data Source: aws_vpclattice_auth_policy + +Terraform data source for managing an AWS VPC Lattice Auth Policy. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpclatticeAuthPolicy } from "./.gen/providers/aws/data-aws-vpclattice-auth-policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpclatticeAuthPolicy(this, "test", { + resourceIdentifier: Token.asString( + awsVpclatticeAuthPolicyTest.resourceIdentifier + ), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `resourceIdentifier` - (Required) The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `policy` - The auth policy. The policy string in JSON must not contain newlines or blank lines. +* `state` - The state of the auth policy. The auth policy is only active when the auth type is set to AWS_IAM. If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the Auth type is NONE, then, any auth policy you provide will remain inactive. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpclattice_listener.html.markdown b/website/docs/cdktf/typescript/d/vpclattice_listener.html.markdown new file mode 100644 index 00000000000..4fe35677079 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpclattice_listener.html.markdown @@ -0,0 +1,67 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_listener" +description: |- + Terraform data source for managing an AWS VPC Lattice Listener. +--- + + + +# Data Source: aws_vpclattice_listener + +Terraform data source for managing an AWS VPC Lattice Listener. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpclatticeListener } from "./.gen/providers/aws/data-aws-vpclattice-listener"; +interface MyConfig { + listenerIdentifier: any; + serviceIdentifier: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + new DataAwsVpclatticeListener(this, "example", { + listenerIdentifier: config.listenerIdentifier, + serviceIdentifier: config.serviceIdentifier, + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `serviceIdentifier` - (Required) ID or Amazon Resource Name (ARN) of the service network +* `listenerIdentifier` - (Required) ID or Amazon Resource Name (ARN) of the listener + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the listener. +* `createdAt` - The date and time that the listener was created. +* `defaultAction` - The actions for the default listener rule. +* `lastUpdatedAt` - The date and time the listener was last updated. +* `listenerId` - The ID of the listener. +* `name` - The name of the listener. +* `port` - The listener port. +* `protocol` - The listener protocol. Either `https` or `http`. +* `serviceArn` - The ARN of the service. +* `serviceId` - The ID of the service. +* `tags` - List of tags associated with the listener. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpclattice_resource_policy.html.markdown b/website/docs/cdktf/typescript/d/vpclattice_resource_policy.html.markdown new file mode 100644 index 00000000000..75623336557 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpclattice_resource_policy.html.markdown @@ -0,0 +1,51 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_resource_policy" +description: |- + Terraform data source for managing an AWS VPC Lattice Resource Policy. +--- + + + +# Data Source: aws_vpclattice_resource_policy + +Terraform data source for managing an AWS VPC Lattice Resource Policy. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpclatticeResourcePolicy } from "./.gen/providers/aws/data-aws-vpclattice-resource-policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpclatticeResourcePolicy(this, "example", { + resourceArn: Token.asString(awsVpclatticeServiceNetworkExample.arn), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `resourceArn` - (Required) Resource ARN of the resource for which a policy is retrieved. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `policy` - JSON-encoded string representation of the applied resource policy. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpclattice_service.html.markdown b/website/docs/cdktf/typescript/d/vpclattice_service.html.markdown new file mode 100644 index 00000000000..028e0d423f5 --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpclattice_service.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service" +description: |- + Terraform data source for managing an AWS VPC Lattice Service. +--- + + + +# Data Source: aws_vpclattice_service + +Terraform data source for managing an AWS VPC Lattice Service. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpclatticeService } from "./.gen/providers/aws/data-aws-vpclattice-service"; +interface MyConfig { + serviceIdentifier: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + new DataAwsVpclatticeService(this, "example", { + serviceIdentifier: config.serviceIdentifier, + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `serviceIdentifier` - (Required) ID or Amazon Resource Name (ARN) of the service network + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the service. +* `authType` - Type of IAM policy. Either `none` or `awsIam`. +* `certificateArn` - Amazon Resource Name (ARN) of the certificate. +* `customDomainName` - Custom domain name of the service. +* `dnsEntry` - DNS name of the service. +* `id` - Unique identifier for the service. +* `status` - Status of the service. +* `tags` - List of tags associated with the service. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpclattice_service_network.html.markdown b/website/docs/cdktf/typescript/d/vpclattice_service_network.html.markdown new file mode 100644 index 00000000000..e2372705a8d --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpclattice_service_network.html.markdown @@ -0,0 +1,58 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service_network" +description: |- + Terraform data source for managing an AWS VPC Lattice Service Network. +--- + + + +# Data Source: aws_vpclattice_service_network + +Terraform data source for managing an AWS VPC Lattice Service Network. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpclatticeServiceNetwork } from "./.gen/providers/aws/data-aws-vpclattice-service-network"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new DataAwsVpclatticeServiceNetwork(this, "example", { + serviceNetworkIdentifier: "", + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `serviceNetworkIdentifier` - (Required) Identifier of the network service. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the Service Network. +* `authType` - Authentication type for the service network. Either `none` or `awsIam`. +* `createdAt` - Date and time the service network was created. +* `id` - ID of the service network. +* `lastUpdatedAt` - Date and time the service network was last updated. +* `name` - Name of the service network. +* `numberOfAssociatedServices` - Number of services associated with this service network. +* `numberOfAssociatedVpcs` - Number of VPCs associated with this service network. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/d/vpcs.html.markdown b/website/docs/cdktf/typescript/d/vpcs.html.markdown new file mode 100644 index 00000000000..769918d06ca --- /dev/null +++ b/website/docs/cdktf/typescript/d/vpcs.html.markdown @@ -0,0 +1,136 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpcs" +description: |- + Provides a list of VPC Ids in a region +--- + + + +# Data Source: aws_vpcs + +This resource can be useful for getting back a list of VPC Ids for a region. + +The following example retrieves a list of VPC Ids with a custom tag of `service` set to a value of "production". + +## Example Usage + +The following shows outputting all VPC Ids. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformOutput, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcs } from "./.gen/providers/aws/data-aws-vpcs"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const foo = new DataAwsVpcs(this, "foo", { + tags: { + service: "production", + }, + }); + const cdktfTerraformOutputFoo = new TerraformOutput(this, "foo_1", { + value: foo.ids, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + cdktfTerraformOutputFoo.overrideLogicalId("foo"); + } +} + +``` + +An example use case would be interpolate the `awsVpcs` output into `count` of an aws_flow_log resource. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + TerraformOutput, + Fn, + Token, + TerraformCount, + propertyAccess, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpc } from "./.gen/providers/aws/data-aws-vpc"; +import { DataAwsVpcs } from "./.gen/providers/aws/data-aws-vpcs"; +import { FlowLog } from "./.gen/providers/aws/flow-log"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const foo = new DataAwsVpcs(this, "foo", {}); + const cdktfTerraformOutputFoo = new TerraformOutput(this, "foo_1", { + value: foo.ids, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + cdktfTerraformOutputFoo.overrideLogicalId("foo"); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const fooCount = TerraformCount.of(Token.asNumber(Fn.lengthOf(foo.ids))); + const dataAwsVpcFoo = new DataAwsVpc(this, "foo_2", { + id: Token.asString(propertyAccess(Fn.tolist(foo.ids), [fooCount.index])), + count: fooCount, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataAwsVpcFoo.overrideLogicalId("foo"); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const testFlowLogCount = TerraformCount.of( + Token.asNumber(Fn.lengthOf(foo.ids)) + ); + new FlowLog(this, "test_flow_log", { + vpcId: Token.asString( + propertyAccess( + propertyAccess(dataAwsVpcFoo, [testFlowLogCount.index]), + ["id"] + ) + ), + count: testFlowLogCount, + }); + } +} + +``` + +## Argument Reference + +* `tags` - (Optional) Map of tags, each pair of which must exactly match + a pair on the desired vpcs. + +* `filter` - (Optional) Custom filter block as described below. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: + +* `name` - (Required) Name of the field to filter by, as defined by + [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html). + +* `values` - (Required) Set of values that are accepted for the given field. + A VPC will be selected if any one of the given values matches. + +## Attributes Reference + +* `id` - AWS Region. +* `ids` - List of all the VPC Ids found. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `read` - (Default `20M`) + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_availability_zone_group.html.markdown b/website/docs/cdktf/typescript/r/ec2_availability_zone_group.html.markdown index d85ad9d6400..98a75ed34ee 100644 --- a/website/docs/cdktf/typescript/r/ec2_availability_zone_group.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_availability_zone_group.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Availability Zone Group. --- + + # Resource: aws_ec2_availability_zone_group Manages an EC2 Availability Zone Group, such as updating its opt-in status. @@ -15,15 +17,18 @@ Manages an EC2 Availability Zone Group, such as updating its opt-in status. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2AvailabilityZoneGroup } from "./.gen/providers/aws/ec2-availability-zone-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.ec2AvailabilityZoneGroup.Ec2AvailabilityZoneGroup(this, "example", { + new Ec2AvailabilityZoneGroup(this, "example", { groupName: "us-west-2-lax-1", optInStatus: "opted-in", }); @@ -53,4 +58,4 @@ EC2 Availability Zone Groups can be imported using the group name, e.g., $ terraform import aws_ec2_availability_zone_group.example us-west-2-lax-1 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_capacity_reservation.html.markdown b/website/docs/cdktf/typescript/r/ec2_capacity_reservation.html.markdown index cff3cff8264..ce65fd6ccb6 100644 --- a/website/docs/cdktf/typescript/r/ec2_capacity_reservation.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_capacity_reservation.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an EC2 Capacity Reservation. This allows you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration. --- + + # Resource: aws_ec2_capacity_reservation Provides an EC2 Capacity Reservation. This allows you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration. @@ -13,15 +15,18 @@ Provides an EC2 Capacity Reservation. This allows you to reserve capacity for yo ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2CapacityReservation } from "./.gen/providers/aws/ec2-capacity-reservation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.ec2CapacityReservation.Ec2CapacityReservation(this, "default", { + new Ec2CapacityReservation(this, "default", { availabilityZone: "eu-west-1a", instanceCount: 1, instancePlatform: "Linux/UNIX", @@ -67,4 +72,4 @@ Capacity Reservations can be imported using the `id`, e.g., $ terraform import aws_ec2_capacity_reservation.web cr-0123456789abcdef0 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_carrier_gateway.html.markdown b/website/docs/cdktf/typescript/r/ec2_carrier_gateway.html.markdown index 6f25fe24500..23a41c37e73 100644 --- a/website/docs/cdktf/typescript/r/ec2_carrier_gateway.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_carrier_gateway.html.markdown @@ -6,20 +6,35 @@ description: |- Manages an EC2 Carrier Gateway. --- + + # Resource: aws_ec2_carrier_gateway Manages an EC2 Carrier Gateway. See the AWS [documentation](https://docs.aws.amazon.com/vpc/latest/userguide/Carrier_Gateway.html) for more information. ## Example Usage -```terraform -resource "aws_ec2_carrier_gateway" "example" { - vpc_id = aws_vpc.example.id - - tags = { - Name = "example-carrier-gateway" +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2CarrierGateway } from "./.gen/providers/aws/ec2-carrier-gateway"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2CarrierGateway(this, "example", { + tags: { + Name: "example-carrier-gateway", + }, + vpcId: Token.asString(awsVpcExample.id), + }); } } + ``` ## Argument Reference @@ -47,4 +62,4 @@ e.g., $ terraform import aws_ec2_carrier_gateway.example cgw-12345 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_client_vpn_authorization_rule.html.markdown b/website/docs/cdktf/typescript/r/ec2_client_vpn_authorization_rule.html.markdown index acc80488b16..4e332caa56c 100644 --- a/website/docs/cdktf/typescript/r/ec2_client_vpn_authorization_rule.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_client_vpn_authorization_rule.html.markdown @@ -6,6 +6,8 @@ description: |- Provides authorization rules for AWS Client VPN endpoints. --- + + # Resource: aws_ec2_client_vpn_authorization_rule Provides authorization rules for AWS Client VPN endpoints. For more information on usage, please see the @@ -13,12 +15,26 @@ Provides authorization rules for AWS Client VPN endpoints. For more information ## Example Usage -```terraform -resource "aws_ec2_client_vpn_authorization_rule" "example" { - client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id - target_network_cidr = aws_subnet.example.cidr_block - authorize_all_groups = true +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2ClientVpnAuthorizationRule } from "./.gen/providers/aws/ec2-client-vpn-authorization-rule"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2ClientVpnAuthorizationRule(this, "example", { + authorizeAllGroups: true, + clientVpnEndpointId: Token.asString(awsEc2ClientVpnEndpointExample.id), + targetNetworkCidr: Token.asString(awsSubnetExample.cidrBlock), + }); + } } + ``` ## Argument Reference @@ -54,4 +70,4 @@ $ terraform import aws_ec2_client_vpn_authorization_rule.example cvpn-endpoint-0 $ terraform import aws_ec2_client_vpn_authorization_rule.example cvpn-endpoint-0ac3a1abbccddd666,10.1.0.0/24,team-a ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_client_vpn_endpoint.html.markdown b/website/docs/cdktf/typescript/r/ec2_client_vpn_endpoint.html.markdown index eff705144e8..49ceee1cde1 100644 --- a/website/docs/cdktf/typescript/r/ec2_client_vpn_endpoint.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_client_vpn_endpoint.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an AWS Client VPN endpoint for OpenVPN clients. --- + + # Resource: aws_ec2_client_vpn_endpoint Provides an AWS Client VPN endpoint for OpenVPN clients. For more information on usage, please see the @@ -13,23 +15,37 @@ Provides an AWS Client VPN endpoint for OpenVPN clients. For more information on ## Example Usage -```terraform -resource "aws_ec2_client_vpn_endpoint" "example" { - description = "terraform-clientvpn-example" - server_certificate_arn = aws_acm_certificate.cert.arn - client_cidr_block = "10.0.0.0/16" - - authentication_options { - type = "certificate-authentication" - root_certificate_chain_arn = aws_acm_certificate.root_cert.arn - } - - connection_log_options { - enabled = true - cloudwatch_log_group = aws_cloudwatch_log_group.lg.name - cloudwatch_log_stream = aws_cloudwatch_log_stream.ls.name +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2ClientVpnEndpoint } from "./.gen/providers/aws/ec2-client-vpn-endpoint"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2ClientVpnEndpoint(this, "example", { + authenticationOptions: [ + { + rootCertificateChainArn: rootCert.arn, + type: "certificate-authentication", + }, + ], + clientCidrBlock: "10.0.0.0/16", + connectionLogOptions: { + cloudwatchLogGroup: lg.name, + cloudwatchLogStream: ls.name, + enabled: true, + }, + description: "terraform-clientvpn-example", + serverCertificateArn: cert.arn, + }); } } + ``` ## Argument Reference @@ -98,4 +114,4 @@ AWS Client VPN endpoints can be imported using the `id` value found via `aws ec2 $ terraform import aws_ec2_client_vpn_endpoint.example cvpn-endpoint-0ac3a1abbccddd666 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_client_vpn_network_association.html.markdown b/website/docs/cdktf/typescript/r/ec2_client_vpn_network_association.html.markdown index 3aa5700d035..fbf0cefea91 100644 --- a/website/docs/cdktf/typescript/r/ec2_client_vpn_network_association.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_client_vpn_network_association.html.markdown @@ -6,6 +6,8 @@ description: |- Provides network associations for AWS Client VPN endpoints. --- + + # Resource: aws_ec2_client_vpn_network_association Provides network associations for AWS Client VPN endpoints. For more information on usage, please see the @@ -13,11 +15,25 @@ Provides network associations for AWS Client VPN endpoints. For more information ## Example Usage -```terraform -resource "aws_ec2_client_vpn_network_association" "example" { - client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id - subnet_id = aws_subnet.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2ClientVpnNetworkAssociation } from "./.gen/providers/aws/ec2-client-vpn-network-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2ClientVpnNetworkAssociation(this, "example", { + clientVpnEndpointId: Token.asString(awsEc2ClientVpnEndpointExample.id), + subnetId: Token.asString(awsSubnetExample.id), + }); + } } + ``` ## Argument Reference @@ -50,4 +66,4 @@ AWS Client VPN network associations can be imported using the endpoint ID and th $ terraform import aws_ec2_client_vpn_network_association.example cvpn-endpoint-0ac3a1abbccddd666,vpn-assoc-0b8db902465d069ad ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_client_vpn_route.html.markdown b/website/docs/cdktf/typescript/r/ec2_client_vpn_route.html.markdown index 41bf409c140..61e4ab40edc 100644 --- a/website/docs/cdktf/typescript/r/ec2_client_vpn_route.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_client_vpn_route.html.markdown @@ -6,6 +6,8 @@ description: |- Provides additional routes for AWS Client VPN endpoints. --- + + # Resource: aws_ec2_client_vpn_route Provides additional routes for AWS Client VPN endpoints. For more information on usage, please see the @@ -13,32 +15,57 @@ Provides additional routes for AWS Client VPN endpoints. For more information on ## Example Usage -```terraform -resource "aws_ec2_client_vpn_route" "example" { - client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id - destination_cidr_block = "0.0.0.0/0" - target_vpc_subnet_id = aws_ec2_client_vpn_network_association.example.subnet_id -} - -resource "aws_ec2_client_vpn_network_association" "example" { - client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id - subnet_id = aws_subnet.example.id -} - -resource "aws_ec2_client_vpn_endpoint" "example" { - description = "Example Client VPN endpoint" - server_certificate_arn = aws_acm_certificate.example.arn - client_cidr_block = "10.0.0.0/16" - - authentication_options { - type = "certificate-authentication" - root_certificate_chain_arn = aws_acm_certificate.example.arn - } - - connection_log_options { - enabled = false +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2ClientVpnEndpoint } from "./.gen/providers/aws/ec2-client-vpn-endpoint"; +import { Ec2ClientVpnNetworkAssociation } from "./.gen/providers/aws/ec2-client-vpn-network-association"; +import { Ec2ClientVpnRoute } from "./.gen/providers/aws/ec2-client-vpn-route"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Ec2ClientVpnEndpoint(this, "example", { + authenticationOptions: [ + { + rootCertificateChainArn: Token.asString(awsAcmCertificateExample.arn), + type: "certificate-authentication", + }, + ], + clientCidrBlock: "10.0.0.0/16", + connectionLogOptions: { + enabled: false, + }, + description: "Example Client VPN endpoint", + serverCertificateArn: Token.asString(awsAcmCertificateExample.arn), + }); + const awsEc2ClientVpnNetworkAssociationExample = + new Ec2ClientVpnNetworkAssociation(this, "example_1", { + clientVpnEndpointId: example.id, + subnetId: Token.asString(awsSubnetExample.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsEc2ClientVpnNetworkAssociationExample.overrideLogicalId("example"); + const awsEc2ClientVpnRouteExample = new Ec2ClientVpnRoute( + this, + "example_2", + { + clientVpnEndpointId: example.id, + destinationCidrBlock: "0.0.0.0/0", + targetVpcSubnetId: Token.asString( + awsEc2ClientVpnNetworkAssociationExample.subnetId + ), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsEc2ClientVpnRouteExample.overrideLogicalId("example"); } } + ``` ## Argument Reference @@ -73,4 +100,4 @@ AWS Client VPN routes can be imported using the endpoint ID, target subnet ID, a $ terraform import aws_ec2_client_vpn_route.example cvpn-endpoint-1234567890abcdef,subnet-9876543210fedcba,10.1.0.0/24 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_fleet.html.markdown b/website/docs/cdktf/typescript/r/ec2_fleet.html.markdown index 1a3f6c29677..5a95b11adf3 100644 --- a/website/docs/cdktf/typescript/r/ec2_fleet.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_fleet.html.markdown @@ -6,26 +6,43 @@ description: |- Provides a resource to manage EC2 Fleets --- + + # Resource: aws_ec2_fleet Provides a resource to manage EC2 Fleets. ## Example Usage -```terraform -resource "aws_ec2_fleet" "example" { - launch_template_config { - launch_template_specification { - launch_template_id = aws_launch_template.example.id - version = aws_launch_template.example.latest_version - } - } - - target_capacity_specification { - default_target_capacity_type = "spot" - total_target_capacity = 5 +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2Fleet } from "./.gen/providers/aws/ec2-fleet"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2Fleet(this, "example", { + launchTemplateConfig: [ + { + launchTemplateSpecification: { + launchTemplateId: Token.asString(awsLaunchTemplateExample.id), + version: Token.asString(awsLaunchTemplateExample.latestVersion), + }, + }, + ], + targetCapacitySpecification: { + defaultTargetCapacityType: "spot", + totalTargetCapacity: 5, + }, + }); } } + ``` ## Argument Reference @@ -67,24 +84,41 @@ Any parameters that you specify override the same parameters in the launch templ Example: -```terraform -resource "aws_ec2_fleet" "example" { - # ... other configuration ... - - launch_template_config { - # ... other configuration ... - - override { - instance_type = "m4.xlarge" - weighted_capacity = 1 - } - - override { - instance_type = "m4.2xlarge" - weighted_capacity = 2 - } +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2Fleet } from "./.gen/providers/aws/ec2-fleet"; +interface MyConfig { + targetCapacitySpecification: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + new Ec2Fleet(this, "example", { + launchTemplateConfig: [ + { + override: [ + { + instanceType: "m4.xlarge", + weightedCapacity: 1, + }, + { + instanceType: "m4.2xlarge", + weightedCapacity: 2, + }, + ], + }, + ], + targetCapacitySpecification: config.targetCapacitySpecification, + }); } } + ``` * `availabilityZone` - (Optional) Availability Zone in which to launch the instances. @@ -231,4 +265,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_fleet.example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080c ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_host.html.markdown b/website/docs/cdktf/typescript/r/ec2_host.html.markdown index 2036435dbc9..2038d250e73 100644 --- a/website/docs/cdktf/typescript/r/ec2_host.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_host.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an EC2 Host resource. This allows Dedicated Hosts to be allocated, modified, and released. --- + + # Resource: aws_ec2_host Provides an EC2 Host resource. This allows Dedicated Hosts to be allocated, modified, and released. @@ -13,15 +15,18 @@ Provides an EC2 Host resource. This allows Dedicated Hosts to be allocated, modi ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2Host } from "./.gen/providers/aws/ec2-host"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.ec2Host.Ec2Host(this, "test", { + new Ec2Host(this, "test", { autoPlacement: "on", availabilityZone: "us-west-2a", hostRecovery: "on", @@ -61,4 +66,4 @@ Hosts can be imported using the host `id`, e.g., $ terraform import aws_ec2_host.example h-0385a99d0e4b20cbb ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_instance_state.html.markdown b/website/docs/cdktf/typescript/r/ec2_instance_state.html.markdown index bb48123e169..b5abaf9ed7a 100644 --- a/website/docs/cdktf/typescript/r/ec2_instance_state.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_instance_state.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an EC2 instance state resource. This allows managing an instance power state. --- + + # Resource: aws_ec2_instance_state Provides an EC2 instance state resource. This allows managing an instance power state. @@ -15,15 +17,20 @@ Provides an EC2 instance state resource. This allows managing an instance power ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsAmi } from "./.gen/providers/aws/data-aws-ami"; +import { Ec2InstanceState } from "./.gen/providers/aws/ec2-instance-state"; +import { Instance } from "./.gen/providers/aws/instance"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const dataAwsAmiUbuntu = new aws.dataAwsAmi.DataAwsAmi(this, "ubuntu", { + const ubuntu = new DataAwsAmi(this, "ubuntu", { filter: [ { name: "name", @@ -37,21 +44,17 @@ class MyConvertedCode extends cdktf.TerraformStack { mostRecent: true, owners: ["099720109477"], }); - const awsInstanceTest = new aws.instance.Instance(this, "test", { - ami: cdktf.Token.asString(dataAwsAmiUbuntu.id), + const test = new Instance(this, "test", { + ami: Token.asString(ubuntu.id), instanceType: "t3.micro", tags: { Name: "HelloWorld", }, }); - const awsEc2InstanceStateTest = new aws.ec2InstanceState.Ec2InstanceState( - this, - "test_2", - { - instanceId: cdktf.Token.asString(awsInstanceTest.id), - state: "stopped", - } - ); + const awsEc2InstanceStateTest = new Ec2InstanceState(this, "test_2", { + instanceId: test.id, + state: "stopped", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ awsEc2InstanceStateTest.overrideLogicalId("test"); } @@ -92,4 +95,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_instance_state.test i-02cae6557dfcf2f96 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_local_gateway_route.html.markdown b/website/docs/cdktf/typescript/r/ec2_local_gateway_route.html.markdown index 28e1e07636b..13889e9027b 100644 --- a/website/docs/cdktf/typescript/r/ec2_local_gateway_route.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_local_gateway_route.html.markdown @@ -6,18 +6,38 @@ description: |- Manages an EC2 Local Gateway Route --- + + # Resource: aws_ec2_local_gateway_route Manages an EC2 Local Gateway Route. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing). ## Example Usage -```terraform -resource "aws_ec2_local_gateway_route" "example" { - destination_cidr_block = "172.16.0.0/16" - local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.example.id - local_gateway_virtual_interface_group_id = data.aws_ec2_local_gateway_virtual_interface_group.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2LocalGatewayRoute } from "./.gen/providers/aws/ec2-local-gateway-route"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2LocalGatewayRoute(this, "example", { + destinationCidrBlock: "172.16.0.0/16", + localGatewayRouteTableId: Token.asString( + dataAwsEc2LocalGatewayRouteTableExample.id + ), + localGatewayVirtualInterfaceGroupId: Token.asString( + dataAwsEc2LocalGatewayVirtualInterfaceGroupExample.id + ), + }); + } } + ``` ## Argument Reference @@ -42,4 +62,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_local_gateway_route.example lgw-rtb-12345678_172.16.0.0/16 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_local_gateway_route_table_vpc_association.html.markdown b/website/docs/cdktf/typescript/r/ec2_local_gateway_route_table_vpc_association.html.markdown index c9c869c999f..b828a524155 100644 --- a/website/docs/cdktf/typescript/r/ec2_local_gateway_route_table_vpc_association.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_local_gateway_route_table_vpc_association.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Local Gateway Route Table VPC Association --- + + # Resource: aws_ec2_local_gateway_route_table_vpc_association Manages an EC2 Local Gateway Route Table VPC Association. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-local-gateways.html#vpc-associations). @@ -13,39 +15,36 @@ Manages an EC2 Local Gateway Route Table VPC Association. More information can b ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsEc2LocalGatewayRouteTable } from "./.gen/providers/aws/data-aws-ec2-local-gateway-route-table"; +import { Ec2LocalGatewayRouteTableVpcAssociation } from "./.gen/providers/aws/ec2-local-gateway-route-table-vpc-association"; +import { Vpc } from "./.gen/providers/aws/vpc"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const awsVpcExample = new aws.vpc.Vpc(this, "example", { + const example = new Vpc(this, "example", { cidrBlock: "10.0.0.0/16", }); const dataAwsEc2LocalGatewayRouteTableExample = - new aws.dataAwsEc2LocalGatewayRouteTable.DataAwsEc2LocalGatewayRouteTable( - this, - "example_1", - { - outpostArn: - "arn:aws:outposts:us-west-2:123456789012:outpost/op-1234567890abcdef", - } - ); + new DataAwsEc2LocalGatewayRouteTable(this, "example_1", { + outpostArn: + "arn:aws:outposts:us-west-2:123456789012:outpost/op-1234567890abcdef", + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataAwsEc2LocalGatewayRouteTableExample.overrideLogicalId("example"); const awsEc2LocalGatewayRouteTableVpcAssociationExample = - new aws.ec2LocalGatewayRouteTableVpcAssociation.Ec2LocalGatewayRouteTableVpcAssociation( - this, - "example_2", - { - localGatewayRouteTableId: cdktf.Token.asString( - dataAwsEc2LocalGatewayRouteTableExample.id - ), - vpcId: cdktf.Token.asString(awsVpcExample.id), - } - ); + new Ec2LocalGatewayRouteTableVpcAssociation(this, "example_2", { + localGatewayRouteTableId: Token.asString( + dataAwsEc2LocalGatewayRouteTableExample.id + ), + vpcId: example.id, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ awsEc2LocalGatewayRouteTableVpcAssociationExample.overrideLogicalId( "example" @@ -81,4 +80,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_local_gateway_route_table_vpc_association.example lgw-vpc-assoc-1234567890abcdef ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_managed_prefix_list.html.markdown b/website/docs/cdktf/typescript/r/ec2_managed_prefix_list.html.markdown index af7161ae114..3962e759304 100644 --- a/website/docs/cdktf/typescript/r/ec2_managed_prefix_list.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_managed_prefix_list.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a managed prefix list resource. --- + + # Resource: aws_ec2_managed_prefix_list Provides a managed prefix list resource. @@ -26,26 +28,39 @@ as 20 rules for the security group. Basic usage -```terraform -resource "aws_ec2_managed_prefix_list" "example" { - name = "All VPC CIDR-s" - address_family = "IPv4" - max_entries = 5 - - entry { - cidr = aws_vpc.example.cidr_block - description = "Primary" - } - - entry { - cidr = aws_vpc_ipv4_cidr_block_association.example.cidr_block - description = "Secondary" - } - - tags = { - Env = "live" +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2ManagedPrefixList } from "./.gen/providers/aws/ec2-managed-prefix-list"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2ManagedPrefixList(this, "example", { + addressFamily: "IPv4", + entry: [ + { + cidr: Token.asString(awsVpcExample.cidrBlock), + description: "Primary", + }, + { + cidr: Token.asString(awsVpcIpv4CidrBlockAssociationExample.cidrBlock), + description: "Secondary", + }, + ], + maxEntries: 5, + name: "All VPC CIDR-s", + tags: { + Env: "live", + }, + }); } } + ``` ## Argument Reference @@ -81,4 +96,4 @@ Prefix Lists can be imported using the `id`, e.g., $ terraform import aws_ec2_managed_prefix_list.default pl-0570a1d2d725c16be ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_managed_prefix_list_entry.html.markdown b/website/docs/cdktf/typescript/r/ec2_managed_prefix_list_entry.html.markdown index 8dc5c9c2981..cdd9b408b5f 100644 --- a/website/docs/cdktf/typescript/r/ec2_managed_prefix_list_entry.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_managed_prefix_list_entry.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a managed prefix list entry resource. --- + + # Resource: aws_ec2_managed_prefix_list_entry Provides a managed prefix list entry resource. @@ -26,22 +28,35 @@ resource instead. Basic usage -```terraform -resource "aws_ec2_managed_prefix_list" "example" { - name = "All VPC CIDR-s" - address_family = "IPv4" - max_entries = 5 - - tags = { - Env = "live" +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2ManagedPrefixList } from "./.gen/providers/aws/ec2-managed-prefix-list"; +import { Ec2ManagedPrefixListEntryA } from "./.gen/providers/aws/ec2-managed-prefix-list-entry"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Ec2ManagedPrefixList(this, "example", { + addressFamily: "IPv4", + maxEntries: 5, + name: "All VPC CIDR-s", + tags: { + Env: "live", + }, + }); + new Ec2ManagedPrefixListEntryA(this, "entry_1", { + cidr: Token.asString(awsVpcExample.cidrBlock), + description: "Primary", + prefixListId: example.id, + }); } } -resource "aws_ec2_managed_prefix_list_entry" "entry_1" { - cidr = aws_vpc.example.cidr_block - description = "Primary" - prefix_list_id = aws_ec2_managed_prefix_list.example.id -} ``` ## Argument Reference @@ -66,4 +81,4 @@ Prefix List Entries can be imported using the `prefixListId` and `cidr` separate $ terraform import aws_ec2_managed_prefix_list_entry.default pl-0570a1d2d725c16be,10.0.3.0/24 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_network_insights_analysis.html.markdown b/website/docs/cdktf/typescript/r/ec2_network_insights_analysis.html.markdown index 151003b3057..95d59a83a79 100644 --- a/website/docs/cdktf/typescript/r/ec2_network_insights_analysis.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_network_insights_analysis.html.markdown @@ -6,22 +6,38 @@ description: |- Provides a Network Insights Analysis resource. --- + + # Resource: aws_ec2_network_insights_analysis Provides a Network Insights Analysis resource. Part of the "Reachability Analyzer" service in the AWS VPC console. ## Example Usage -```terraform -resource "aws_ec2_network_insights_path" "path" { - source = aws_network_interface.source.id - destination = aws_network_interface.destination.id - protocol = "tcp" +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2NetworkInsightsAnalysis } from "./.gen/providers/aws/ec2-network-insights-analysis"; +import { Ec2NetworkInsightsPath } from "./.gen/providers/aws/ec2-network-insights-path"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const path = new Ec2NetworkInsightsPath(this, "path", { + destination: destination.id, + protocol: "tcp", + source: source.id, + }); + new Ec2NetworkInsightsAnalysis(this, "analysis", { + networkInsightsPathId: path.id, + }); + } } -resource "aws_ec2_network_insights_analysis" "analysis" { - network_insights_path_id = aws_ec2_network_insights_path.path.id -} ``` ## Argument Reference @@ -66,4 +82,4 @@ Network Insights Analyses can be imported using the `id`, e.g., $ terraform import aws_ec2_network_insights_analysis.test nia-0462085c957f11a55 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_network_insights_path.html.markdown b/website/docs/cdktf/typescript/r/ec2_network_insights_path.html.markdown index db27bf3ed0b..d609e87ad81 100644 --- a/website/docs/cdktf/typescript/r/ec2_network_insights_path.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_network_insights_path.html.markdown @@ -6,18 +6,34 @@ description: |- Provides a Network Insights Path resource. --- + + # Resource: aws_ec2_network_insights_path Provides a Network Insights Path resource. Part of the "Reachability Analyzer" service in the AWS VPC console. ## Example Usage -```terraform -resource "aws_ec2_network_insights_path" "test" { - source = aws_network_interface.source.id - destination = aws_network_interface.destination.id - protocol = "tcp" +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2NetworkInsightsPath } from "./.gen/providers/aws/ec2-network-insights-path"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2NetworkInsightsPath(this, "test", { + destination: destination.id, + protocol: "tcp", + source: source.id, + }); + } } + ``` ## Argument Reference @@ -51,4 +67,4 @@ Network Insights Paths can be imported using the `id`, e.g., $ terraform import aws_ec2_network_insights_path.test nip-00edfba169923aefd ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_serial_console_access.html.markdown b/website/docs/cdktf/typescript/r/ec2_serial_console_access.html.markdown index e4778997a8d..1edb64f20bc 100644 --- a/website/docs/cdktf/typescript/r/ec2_serial_console_access.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_serial_console_access.html.markdown @@ -6,6 +6,8 @@ description: |- Manages whether serial console access is enabled for your AWS account in the current AWS region. --- + + # Resource: aws_ec2_serial_console_access Provides a resource to manage whether serial console access is enabled for your AWS account in the current AWS region. @@ -15,15 +17,18 @@ Provides a resource to manage whether serial console access is enabled for your ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2SerialConsoleAccess } from "./.gen/providers/aws/ec2-serial-console-access"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.ec2SerialConsoleAccess.Ec2SerialConsoleAccess(this, "example", { + new Ec2SerialConsoleAccess(this, "example", { enabled: true, }); } @@ -49,4 +54,4 @@ Serial console access state can be imported, e.g., $ terraform import aws_ec2_serial_console_access.example default ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_subnet_cidr_reservation.html.markdown b/website/docs/cdktf/typescript/r/ec2_subnet_cidr_reservation.html.markdown index 2047c1e5cf4..38123cbd029 100644 --- a/website/docs/cdktf/typescript/r/ec2_subnet_cidr_reservation.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_subnet_cidr_reservation.html.markdown @@ -6,18 +6,34 @@ description: |- Provides a subnet CIDR reservation resource. --- + + # Resource: aws_ec2_subnet_cidr_reservation Provides a subnet CIDR reservation resource. ## Example Usage -```terraform -resource "aws_ec2_subnet_cidr_reservation" "example" { - cidr_block = "10.0.0.16/28" - reservation_type = "prefix" - subnet_id = aws_subnet.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2SubnetCidrReservation } from "./.gen/providers/aws/ec2-subnet-cidr-reservation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2SubnetCidrReservation(this, "example", { + cidrBlock: "10.0.0.16/28", + reservationType: "prefix", + subnetId: Token.asString(awsSubnetExample.id), + }); + } } + ``` ## Argument Reference @@ -44,4 +60,4 @@ Existing CIDR reservations can be imported using `subnetId:reservationId`, e.g., $ terraform import aws_ec2_subnet_cidr_reservation.example subnet-01llsxvsxabqiymcz:scr-4mnvz6wb7otksjcs9 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_tag.html.markdown b/website/docs/cdktf/typescript/r/ec2_tag.html.markdown index b928731433f..0f21b268a2b 100644 --- a/website/docs/cdktf/typescript/r/ec2_tag.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_tag.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an individual EC2 resource tag --- + + # Resource: aws_ec2_tag Manages an individual EC2 resource tag. This resource should only be used in cases where EC2 resources are created outside Terraform (e.g., AMIs), being shared via Resource Access Manager (RAM), or implicitly created by other means (e.g., Transit Gateway VPN Attachments). @@ -17,41 +19,42 @@ Manages an individual EC2 resource tag. This resource should only be used in cas ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { CustomerGateway } from "./.gen/providers/aws/customer-gateway"; +import { Ec2Tag } from "./.gen/providers/aws/ec2-tag"; +import { Ec2TransitGateway } from "./.gen/providers/aws/ec2-transit-gateway"; +import { VpnConnection } from "./.gen/providers/aws/vpn-connection"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const awsCustomerGatewayExample = new aws.customerGateway.CustomerGateway( + const example = new CustomerGateway(this, "example", { + bgpAsn: Token.asString(65000), + ipAddress: "172.0.0.1", + type: "ipsec.1", + }); + const awsEc2TransitGatewayExample = new Ec2TransitGateway( this, - "example", - { - bgpAsn: cdktf.Token.asString(65000), - ipAddress: "172.0.0.1", - type: "ipsec.1", - } + "example_1", + {} ); - const awsEc2TransitGatewayExample = - new aws.ec2TransitGateway.Ec2TransitGateway(this, "example_1", {}); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ awsEc2TransitGatewayExample.overrideLogicalId("example"); - const awsVpnConnectionExample = new aws.vpnConnection.VpnConnection( - this, - "example_2", - { - customerGatewayId: cdktf.Token.asString(awsCustomerGatewayExample.id), - transitGatewayId: cdktf.Token.asString(awsEc2TransitGatewayExample.id), - type: cdktf.Token.asString(awsCustomerGatewayExample.type), - } - ); + const awsVpnConnectionExample = new VpnConnection(this, "example_2", { + customerGatewayId: example.id, + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + type: example.type, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ awsVpnConnectionExample.overrideLogicalId("example"); - const awsEc2TagExample = new aws.ec2Tag.Ec2Tag(this, "example_3", { + const awsEc2TagExample = new Ec2Tag(this, "example_3", { key: "Name", - resourceId: cdktf.Token.asString( + resourceId: Token.asString( awsVpnConnectionExample.transitGatewayAttachmentId ), value: "Hello World", @@ -85,4 +88,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_tag.example tgw-attach-1234567890abcdef,Name ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_traffic_mirror_filter.html.markdown b/website/docs/cdktf/typescript/r/ec2_traffic_mirror_filter.html.markdown index 8ede9b4237a..0306d02bdd6 100644 --- a/website/docs/cdktf/typescript/r/ec2_traffic_mirror_filter.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_traffic_mirror_filter.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an Traffic mirror filter --- + + # Resource: aws_ec2_traffic_mirror_filter Provides an Traffic mirror filter. @@ -16,15 +18,18 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror filter ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TrafficMirrorFilter } from "./.gen/providers/aws/ec2-traffic-mirror-filter"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.ec2TrafficMirrorFilter.Ec2TrafficMirrorFilter(this, "foo", { + new Ec2TrafficMirrorFilter(this, "foo", { description: "traffic mirror filter - terraform example", networkServices: ["amazon-dns"], }); @@ -57,4 +62,4 @@ Traffic mirror filter can be imported using the `id`, e.g., $ terraform import aws_ec2_traffic_mirror_filter.foo tmf-0fbb93ddf38198f64 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_traffic_mirror_filter_rule.html.markdown b/website/docs/cdktf/typescript/r/ec2_traffic_mirror_filter_rule.html.markdown index 5a28fc21392..b7609d24b4c 100644 --- a/website/docs/cdktf/typescript/r/ec2_traffic_mirror_filter_rule.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_traffic_mirror_filter_rule.html.markdown @@ -6,6 +6,8 @@ description: |- Provides an Traffic mirror filter rule --- + + # Resource: aws_ec2_traffic_mirror_filter_rule Provides an Traffic mirror filter rule. @@ -16,58 +18,49 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TrafficMirrorFilter } from "./.gen/providers/aws/ec2-traffic-mirror-filter"; +import { Ec2TrafficMirrorFilterRule } from "./.gen/providers/aws/ec2-traffic-mirror-filter-rule"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const awsEc2TrafficMirrorFilterFilter = - new aws.ec2TrafficMirrorFilter.Ec2TrafficMirrorFilter(this, "filter", { - description: "traffic mirror filter - terraform example", - networkServices: ["amazon-dns"], - }); - new aws.ec2TrafficMirrorFilterRule.Ec2TrafficMirrorFilterRule( - this, - "rulein", - { - description: "test rule", - destinationCidrBlock: "10.0.0.0/8", - destinationPortRange: { - fromPort: 22, - toPort: 53, - }, - protocol: 6, - ruleAction: "accept", - ruleNumber: 1, - sourceCidrBlock: "10.0.0.0/8", - sourcePortRange: { - fromPort: 0, - toPort: 10, - }, - trafficDirection: "ingress", - trafficMirrorFilterId: cdktf.Token.asString( - awsEc2TrafficMirrorFilterFilter.id - ), - } - ); - new aws.ec2TrafficMirrorFilterRule.Ec2TrafficMirrorFilterRule( - this, - "ruleout", - { - description: "test rule", - destinationCidrBlock: "10.0.0.0/8", - ruleAction: "accept", - ruleNumber: 1, - sourceCidrBlock: "10.0.0.0/8", - trafficDirection: "egress", - trafficMirrorFilterId: cdktf.Token.asString( - awsEc2TrafficMirrorFilterFilter.id - ), - } - ); + const filter = new Ec2TrafficMirrorFilter(this, "filter", { + description: "traffic mirror filter - terraform example", + networkServices: ["amazon-dns"], + }); + new Ec2TrafficMirrorFilterRule(this, "rulein", { + description: "test rule", + destinationCidrBlock: "10.0.0.0/8", + destinationPortRange: { + fromPort: 22, + toPort: 53, + }, + protocol: 6, + ruleAction: "accept", + ruleNumber: 1, + sourceCidrBlock: "10.0.0.0/8", + sourcePortRange: { + fromPort: 0, + toPort: 10, + }, + trafficDirection: "ingress", + trafficMirrorFilterId: filter.id, + }); + new Ec2TrafficMirrorFilterRule(this, "ruleout", { + description: "test rule", + destinationCidrBlock: "10.0.0.0/8", + ruleAction: "accept", + ruleNumber: 1, + sourceCidrBlock: "10.0.0.0/8", + trafficDirection: "egress", + trafficMirrorFilterId: filter.id, + }); } } @@ -108,4 +101,4 @@ Traffic mirror rules can be imported using the `trafficMirrorFilterId` and `id` $ terraform import aws_ec2_traffic_mirror_filter_rule.rule tmf-0fbb93ddf38198f64:tmfr-05a458f06445d0aee ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_traffic_mirror_session.html.markdown b/website/docs/cdktf/typescript/r/ec2_traffic_mirror_session.html.markdown index deed6b09f89..6ee861c3aef 100644 --- a/website/docs/cdktf/typescript/r/ec2_traffic_mirror_session.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_traffic_mirror_session.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a Traffic mirror session --- + + # Resource: aws_ec2_traffic_mirror_session Provides an Traffic mirror session. @@ -15,23 +17,37 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session -```terraform -resource "aws_ec2_traffic_mirror_filter" "filter" { - description = "traffic mirror filter - terraform example" - network_services = ["amazon-dns"] -} - -resource "aws_ec2_traffic_mirror_target" "target" { - network_load_balancer_arn = aws_lb.lb.arn +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TrafficMirrorFilter } from "./.gen/providers/aws/ec2-traffic-mirror-filter"; +import { Ec2TrafficMirrorSession } from "./.gen/providers/aws/ec2-traffic-mirror-session"; +import { Ec2TrafficMirrorTarget } from "./.gen/providers/aws/ec2-traffic-mirror-target"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const filter = new Ec2TrafficMirrorFilter(this, "filter", { + description: "traffic mirror filter - terraform example", + networkServices: ["amazon-dns"], + }); + const target = new Ec2TrafficMirrorTarget(this, "target", { + networkLoadBalancerArn: lb.arn, + }); + new Ec2TrafficMirrorSession(this, "session", { + description: "traffic mirror session - terraform example", + networkInterfaceId: test.primaryNetworkInterfaceId, + sessionNumber: 1, + trafficMirrorFilterId: filter.id, + trafficMirrorTargetId: target.id, + }); + } } -resource "aws_ec2_traffic_mirror_session" "session" { - description = "traffic mirror session - terraform example" - network_interface_id = aws_instance.test.primary_network_interface_id - session_number = 1 - traffic_mirror_filter_id = aws_ec2_traffic_mirror_filter.filter.id - traffic_mirror_target_id = aws_ec2_traffic_mirror_target.target.id -} ``` ## Argument Reference @@ -64,4 +80,4 @@ Traffic mirror sessions can be imported using the `id`, e.g., $ terraform import aws_ec2_traffic_mirror_session.session tms-0d8aa3ca35897b82e ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_traffic_mirror_target.html.markdown b/website/docs/cdktf/typescript/r/ec2_traffic_mirror_target.html.markdown index a1f502299e1..f329da704aa 100644 --- a/website/docs/cdktf/typescript/r/ec2_traffic_mirror_target.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_traffic_mirror_target.html.markdown @@ -6,6 +6,8 @@ description: |- Provides a Traffic mirror target --- + + # Resource: aws_ec2_traffic_mirror_target Provides a Traffic mirror target. @@ -15,21 +17,33 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session -```terraform -resource "aws_ec2_traffic_mirror_target" "nlb" { - description = "NLB target" - network_load_balancer_arn = aws_lb.lb.arn -} - -resource "aws_ec2_traffic_mirror_target" "eni" { - description = "ENI target" - network_interface_id = aws_instance.test.primary_network_interface_id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TrafficMirrorTarget } from "./.gen/providers/aws/ec2-traffic-mirror-target"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TrafficMirrorTarget(this, "eni", { + description: "ENI target", + networkInterfaceId: test.primaryNetworkInterfaceId, + }); + new Ec2TrafficMirrorTarget(this, "gwlb", { + description: "GWLB target", + gatewayLoadBalancerEndpointId: example.id, + }); + new Ec2TrafficMirrorTarget(this, "nlb", { + description: "NLB target", + networkLoadBalancerArn: lb.arn, + }); + } } -resource "aws_ec2_traffic_mirror_target" "gwlb" { - description = "GWLB target" - gateway_load_balancer_endpoint_id = aws_vpc_endpoint.example.id -} ``` ## Argument Reference @@ -61,4 +75,4 @@ Traffic mirror targets can be imported using the `id`, e.g., $ terraform import aws_ec2_traffic_mirror_target.target tmt-0c13a005422b86606 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway.html.markdown index e073514f633..68302dc1cbb 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway --- + + # Resource: aws_ec2_transit_gateway Manages an EC2 Transit Gateway. @@ -13,15 +15,18 @@ Manages an EC2 Transit Gateway. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGateway } from "./.gen/providers/aws/ec2-transit-gateway"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - new aws.ec2TransitGateway.Ec2TransitGateway(this, "example", { + new Ec2TransitGateway(this, "example", { description: "example", }); } @@ -74,4 +79,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway.example tgw-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_connect.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_connect.html.markdown index 59e486de9a5..3cc51991b62 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_connect.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_connect.html.markdown @@ -6,23 +6,39 @@ description: |- Manages an EC2 Transit Gateway Connect --- + + # Resource: aws_ec2_transit_gateway_connect Manages an EC2 Transit Gateway Connect. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_vpc_attachment" "example" { - subnet_ids = [aws_subnet.example.id] - transit_gateway_id = aws_ec2_transit_gateway.example.id - vpc_id = aws_vpc.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayConnect } from "./.gen/providers/aws/ec2-transit-gateway-connect"; +import { Ec2TransitGatewayVpcAttachment } from "./.gen/providers/aws/ec2-transit-gateway-vpc-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Ec2TransitGatewayVpcAttachment(this, "example", { + subnetIds: [Token.asString(awsSubnetExample.id)], + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + vpcId: Token.asString(awsVpcExample.id), + }); + new Ec2TransitGatewayConnect(this, "attachment", { + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + transportAttachmentId: example.id, + }); + } } -resource "aws_ec2_transit_gateway_connect" "attachment" { - transport_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_id = aws_ec2_transit_gateway.example.id -} ``` ## Argument Reference @@ -59,4 +75,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_connect.example tgw-attach-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_connect_peer.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_connect_peer.html.markdown index 5c05f186fd7..d25dea8798f 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_connect_peer.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_connect_peer.html.markdown @@ -6,23 +6,44 @@ description: |- Manages an EC2 Transit Gateway Connect Peer --- + + # Resource: aws_ec2_transit_gateway_connect_peer Manages an EC2 Transit Gateway Connect Peer. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_connect" "example" { - transport_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_id = aws_ec2_transit_gateway.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayConnect } from "./.gen/providers/aws/ec2-transit-gateway-connect"; +import { Ec2TransitGatewayConnectPeer } from "./.gen/providers/aws/ec2-transit-gateway-connect-peer"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Ec2TransitGatewayConnect(this, "example", { + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + transportAttachmentId: Token.asString( + awsEc2TransitGatewayVpcAttachmentExample.id + ), + }); + const awsEc2TransitGatewayConnectPeerExample = + new Ec2TransitGatewayConnectPeer(this, "example_1", { + insideCidrBlocks: ["169.254.100.0/29"], + peerAddress: "10.1.2.3", + transitGatewayAttachmentId: example.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsEc2TransitGatewayConnectPeerExample.overrideLogicalId("example"); + } } -resource "aws_ec2_transit_gateway_connect_peer" "example" { - peer_address = "10.1.2.3" - inside_cidr_blocks = ["169.254.100.0/29"] - transit_gateway_attachment_id = aws_ec2_transit_gateway_connect.example.id -} ``` ## Argument Reference @@ -42,6 +63,8 @@ In addition to all arguments above, the following attributes are exported: * `id` - EC2 Transit Gateway Connect Peer identifier * `arn` - EC2 Transit Gateway Connect Peer ARN +* `bgpPeerAddress` - The IP address assigned to customer device, which is used as BGP IP address. +* `bgpTransitGatewayAddresses` - The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses. * `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). ## Timeouts @@ -59,4 +82,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_connect_peer.example tgw-connect-peer-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_domain.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_domain.html.markdown index 02f15ef5c67..f30859baa6b 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_domain.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_domain.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Multicast Domain --- + + # Resource: aws_ec2_transit_gateway_multicast_domain Manages an EC2 Transit Gateway Multicast Domain. @@ -13,204 +15,149 @@ Manages an EC2 Transit Gateway Multicast Domain. ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { propertyAccess, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsAmi } from "./.gen/providers/aws/data-aws-ami"; +import { DataAwsAvailabilityZones } from "./.gen/providers/aws/data-aws-availability-zones"; +import { Ec2TransitGateway } from "./.gen/providers/aws/ec2-transit-gateway"; +import { Ec2TransitGatewayMulticastDomain } from "./.gen/providers/aws/ec2-transit-gateway-multicast-domain"; +import { Ec2TransitGatewayMulticastDomainAssociation } from "./.gen/providers/aws/ec2-transit-gateway-multicast-domain-association"; +import { Ec2TransitGatewayMulticastGroupMember } from "./.gen/providers/aws/ec2-transit-gateway-multicast-group-member"; +import { Ec2TransitGatewayMulticastGroupSource } from "./.gen/providers/aws/ec2-transit-gateway-multicast-group-source"; +import { Ec2TransitGatewayVpcAttachment } from "./.gen/providers/aws/ec2-transit-gateway-vpc-attachment"; +import { Instance } from "./.gen/providers/aws/instance"; +import { Subnet } from "./.gen/providers/aws/subnet"; +import { Vpc } from "./.gen/providers/aws/vpc"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const awsEc2TransitGatewayTgw = new aws.ec2TransitGateway.Ec2TransitGateway( - this, - "tgw", - { - multicastSupport: "enable", - } - ); - const awsEc2TransitGatewayMulticastDomainDomain = - new aws.ec2TransitGatewayMulticastDomain.Ec2TransitGatewayMulticastDomain( - this, - "domain", - { - staticSourcesSupport: "enable", - tags: { - Name: "Transit_Gateway_Multicast_Domain_Example", - }, - transitGatewayId: cdktf.Token.asString(awsEc2TransitGatewayTgw.id), - } - ); - const awsVpcVpc1 = new aws.vpc.Vpc(this, "vpc1", { + const tgw = new Ec2TransitGateway(this, "tgw", { + multicastSupport: "enable", + }); + const domain = new Ec2TransitGatewayMulticastDomain(this, "domain", { + staticSourcesSupport: "enable", + tags: { + Name: "Transit_Gateway_Multicast_Domain_Example", + }, + transitGatewayId: tgw.id, + }); + const vpc1 = new Vpc(this, "vpc1", { cidrBlock: "10.0.0.0/16", }); - const awsVpcVpc2 = new aws.vpc.Vpc(this, "vpc2", { + const vpc2 = new Vpc(this, "vpc2", { cidrBlock: "10.1.0.0/16", }); - const dataAwsAmiAmazonLinux = new aws.dataAwsAmi.DataAwsAmi( - this, - "amazon_linux", - { - filter: [ - { - name: "name", - values: ["amzn-ami-hvm-*-x86_64-gp2"], - }, - { - name: "owner-alias", - values: ["amazon"], - }, - ], - mostRecent: true, - owners: ["amazon"], - } - ); - const dataAwsAvailabilityZonesAvailable = - new aws.dataAwsAvailabilityZones.DataAwsAvailabilityZones( - this, - "available", + const amazonLinux = new DataAwsAmi(this, "amazon_linux", { + filter: [ { - state: "available", - } - ); - const awsSubnetSubnet1 = new aws.subnet.Subnet(this, "subnet1", { - availabilityZone: cdktf.Token.asString( - cdktf.propertyAccess(dataAwsAvailabilityZonesAvailable.names, ["0"]) - ), + name: "name", + values: ["amzn-ami-hvm-*-x86_64-gp2"], + }, + { + name: "owner-alias", + values: ["amazon"], + }, + ], + mostRecent: true, + owners: ["amazon"], + }); + const available = new DataAwsAvailabilityZones(this, "available", { + state: "available", + }); + const subnet1 = new Subnet(this, "subnet1", { + availabilityZone: Token.asString(propertyAccess(available.names, ["0"])), cidrBlock: "10.0.1.0/24", - vpcId: cdktf.Token.asString(awsVpcVpc1.id), + vpcId: vpc1.id, }); - const awsSubnetSubnet2 = new aws.subnet.Subnet(this, "subnet2", { - availabilityZone: cdktf.Token.asString( - cdktf.propertyAccess(dataAwsAvailabilityZonesAvailable.names, ["1"]) - ), + const subnet2 = new Subnet(this, "subnet2", { + availabilityZone: Token.asString(propertyAccess(available.names, ["1"])), cidrBlock: "10.0.2.0/24", - vpcId: cdktf.Token.asString(awsVpcVpc1.id), + vpcId: vpc1.id, }); - const awsSubnetSubnet3 = new aws.subnet.Subnet(this, "subnet3", { - availabilityZone: cdktf.Token.asString( - cdktf.propertyAccess(dataAwsAvailabilityZonesAvailable.names, ["0"]) - ), + const subnet3 = new Subnet(this, "subnet3", { + availabilityZone: Token.asString(propertyAccess(available.names, ["0"])), cidrBlock: "10.1.1.0/24", - vpcId: cdktf.Token.asString(awsVpcVpc2.id), + vpcId: vpc2.id, }); - const awsEc2TransitGatewayVpcAttachmentAttachment1 = - new aws.ec2TransitGatewayVpcAttachment.Ec2TransitGatewayVpcAttachment( - this, - "attachment1", - { - subnetIds: [ - cdktf.Token.asString(awsSubnetSubnet1.id), - cdktf.Token.asString(awsSubnetSubnet2.id), - ], - transitGatewayId: cdktf.Token.asString(awsEc2TransitGatewayTgw.id), - vpcId: cdktf.Token.asString(awsVpcVpc1.id), - } - ); - const awsEc2TransitGatewayVpcAttachmentAttachment2 = - new aws.ec2TransitGatewayVpcAttachment.Ec2TransitGatewayVpcAttachment( - this, - "attachment2", - { - subnetIds: [cdktf.Token.asString(awsSubnetSubnet3.id)], - transitGatewayId: cdktf.Token.asString(awsEc2TransitGatewayTgw.id), - vpcId: cdktf.Token.asString(awsVpcVpc2.id), - } - ); - const awsInstanceInstance1 = new aws.instance.Instance(this, "instance1", { - ami: cdktf.Token.asString(dataAwsAmiAmazonLinux.id), - instanceType: "t2.micro", - subnetId: cdktf.Token.asString(awsSubnetSubnet1.id), - }); - const awsInstanceInstance2 = new aws.instance.Instance(this, "instance2", { - ami: cdktf.Token.asString(dataAwsAmiAmazonLinux.id), - instanceType: "t2.micro", - subnetId: cdktf.Token.asString(awsSubnetSubnet2.id), - }); - const awsInstanceInstance3 = new aws.instance.Instance(this, "instance3", { - ami: cdktf.Token.asString(dataAwsAmiAmazonLinux.id), - instanceType: "t2.micro", - subnetId: cdktf.Token.asString(awsSubnetSubnet3.id), - }); - const awsEc2TransitGatewayMulticastDomainAssociationAssociation1 = - new aws.ec2TransitGatewayMulticastDomainAssociation.Ec2TransitGatewayMulticastDomainAssociation( - this, - "association1", - { - subnetId: cdktf.Token.asString(awsSubnetSubnet1.id), - transitGatewayAttachmentId: cdktf.Token.asString( - awsEc2TransitGatewayVpcAttachmentAttachment1.id - ), - transitGatewayMulticastDomainId: cdktf.Token.asString( - awsEc2TransitGatewayMulticastDomainDomain.id - ), - } - ); - new aws.ec2TransitGatewayMulticastDomainAssociation.Ec2TransitGatewayMulticastDomainAssociation( + const attachment1 = new Ec2TransitGatewayVpcAttachment( this, - "association2", + "attachment1", { - subnetId: cdktf.Token.asString(awsSubnetSubnet2.id), - transitGatewayAttachmentId: cdktf.Token.asString( - awsEc2TransitGatewayVpcAttachmentAttachment2.id - ), - transitGatewayMulticastDomainId: cdktf.Token.asString( - awsEc2TransitGatewayMulticastDomainDomain.id - ), + subnetIds: [subnet1.id, subnet2.id], + transitGatewayId: tgw.id, + vpcId: vpc1.id, } ); - const awsEc2TransitGatewayMulticastDomainAssociationAssociation3 = - new aws.ec2TransitGatewayMulticastDomainAssociation.Ec2TransitGatewayMulticastDomainAssociation( - this, - "association3", - { - subnetId: cdktf.Token.asString(awsSubnetSubnet3.id), - transitGatewayAttachmentId: cdktf.Token.asString( - awsEc2TransitGatewayVpcAttachmentAttachment2.id - ), - transitGatewayMulticastDomainId: cdktf.Token.asString( - awsEc2TransitGatewayMulticastDomainDomain.id - ), - } - ); - new aws.ec2TransitGatewayMulticastGroupMember.Ec2TransitGatewayMulticastGroupMember( + const attachment2 = new Ec2TransitGatewayVpcAttachment( this, - "member1", + "attachment2", { - groupIpAddress: "224.0.0.1", - networkInterfaceId: cdktf.Token.asString( - awsInstanceInstance1.primaryNetworkInterfaceId - ), - transitGatewayMulticastDomainId: cdktf.Token.asString( - awsEc2TransitGatewayMulticastDomainAssociationAssociation1.transitGatewayMulticastDomainId - ), + subnetIds: [subnet3.id], + transitGatewayId: tgw.id, + vpcId: vpc2.id, } ); - new aws.ec2TransitGatewayMulticastGroupMember.Ec2TransitGatewayMulticastGroupMember( + const instance1 = new Instance(this, "instance1", { + ami: Token.asString(amazonLinux.id), + instanceType: "t2.micro", + subnetId: subnet1.id, + }); + const instance2 = new Instance(this, "instance2", { + ami: Token.asString(amazonLinux.id), + instanceType: "t2.micro", + subnetId: subnet2.id, + }); + const instance3 = new Instance(this, "instance3", { + ami: Token.asString(amazonLinux.id), + instanceType: "t2.micro", + subnetId: subnet3.id, + }); + const association1 = new Ec2TransitGatewayMulticastDomainAssociation( this, - "member2", + "association1", { - groupIpAddress: "224.0.0.1", - networkInterfaceId: cdktf.Token.asString( - awsInstanceInstance2.primaryNetworkInterfaceId - ), - transitGatewayMulticastDomainId: cdktf.Token.asString( - awsEc2TransitGatewayMulticastDomainAssociationAssociation1.transitGatewayMulticastDomainId - ), + subnetId: subnet1.id, + transitGatewayAttachmentId: attachment1.id, + transitGatewayMulticastDomainId: domain.id, } ); - new aws.ec2TransitGatewayMulticastGroupSource.Ec2TransitGatewayMulticastGroupSource( + new Ec2TransitGatewayMulticastDomainAssociation(this, "association2", { + subnetId: subnet2.id, + transitGatewayAttachmentId: attachment2.id, + transitGatewayMulticastDomainId: domain.id, + }); + const association3 = new Ec2TransitGatewayMulticastDomainAssociation( this, - "source", + "association3", { - groupIpAddress: "224.0.0.1", - networkInterfaceId: cdktf.Token.asString( - awsInstanceInstance3.primaryNetworkInterfaceId - ), - transitGatewayMulticastDomainId: cdktf.Token.asString( - awsEc2TransitGatewayMulticastDomainAssociationAssociation3.transitGatewayMulticastDomainId - ), + subnetId: subnet3.id, + transitGatewayAttachmentId: attachment2.id, + transitGatewayMulticastDomainId: domain.id, } ); + new Ec2TransitGatewayMulticastGroupMember(this, "member1", { + groupIpAddress: "224.0.0.1", + networkInterfaceId: instance1.primaryNetworkInterfaceId, + transitGatewayMulticastDomainId: + association1.transitGatewayMulticastDomainId, + }); + new Ec2TransitGatewayMulticastGroupMember(this, "member2", { + groupIpAddress: "224.0.0.1", + networkInterfaceId: instance2.primaryNetworkInterfaceId, + transitGatewayMulticastDomainId: + association1.transitGatewayMulticastDomainId, + }); + new Ec2TransitGatewayMulticastGroupSource(this, "source", { + groupIpAddress: "224.0.0.1", + networkInterfaceId: instance3.primaryNetworkInterfaceId, + transitGatewayMulticastDomainId: + association3.transitGatewayMulticastDomainId, + }); } } @@ -250,4 +197,4 @@ In addition to all arguments above, the following attributes are exported: terraform import aws_ec2_transit_gateway_multicast_domain.example tgw-mcast-domain-12345 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_domain_association.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_domain_association.html.markdown index cfb4ded0a39..7bc7c0f3cea 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_domain_association.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_domain_association.html.markdown @@ -6,32 +6,63 @@ description: |- Manages an EC2 Transit Gateway Multicast Domain Association --- + + # Resource: aws_ec2_transit_gateway_multicast_domain_association Associates the specified subnet and transit gateway attachment with the specified transit gateway multicast domain. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway" "example" { - multicast_support = "enable" -} - -resource "aws_ec2_transit_gateway_vpc_attachment" "example" { - subnet_ids = [aws_subnet.example.id] - transit_gateway_id = aws_ec2_transit_gateway.example.id - vpc_id = aws_vpc.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGateway } from "./.gen/providers/aws/ec2-transit-gateway"; +import { Ec2TransitGatewayMulticastDomain } from "./.gen/providers/aws/ec2-transit-gateway-multicast-domain"; +import { Ec2TransitGatewayMulticastDomainAssociation } from "./.gen/providers/aws/ec2-transit-gateway-multicast-domain-association"; +import { Ec2TransitGatewayVpcAttachment } from "./.gen/providers/aws/ec2-transit-gateway-vpc-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Ec2TransitGateway(this, "example", { + multicastSupport: "enable", + }); + const awsEc2TransitGatewayMulticastDomainExample = + new Ec2TransitGatewayMulticastDomain(this, "example_1", { + transitGatewayId: example.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsEc2TransitGatewayMulticastDomainExample.overrideLogicalId("example"); + const awsEc2TransitGatewayVpcAttachmentExample = + new Ec2TransitGatewayVpcAttachment(this, "example_2", { + subnetIds: [Token.asString(awsSubnetExample.id)], + transitGatewayId: example.id, + vpcId: Token.asString(awsVpcExample.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsEc2TransitGatewayVpcAttachmentExample.overrideLogicalId("example"); + const awsEc2TransitGatewayMulticastDomainAssociationExample = + new Ec2TransitGatewayMulticastDomainAssociation(this, "example_3", { + subnetId: Token.asString(awsSubnetExample.id), + transitGatewayAttachmentId: Token.asString( + awsEc2TransitGatewayVpcAttachmentExample.id + ), + transitGatewayMulticastDomainId: Token.asString( + awsEc2TransitGatewayMulticastDomainExample.id + ), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsEc2TransitGatewayMulticastDomainAssociationExample.overrideLogicalId( + "example" + ); + } } -resource "aws_ec2_transit_gateway_multicast_domain" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id -} - -resource "aws_ec2_transit_gateway_multicast_domain_association" "example" { - subnet_id = aws_subnet.example.id - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_multicast_domain_id = aws_ec2_transit_gateway_multicast_domain.example.id -} ``` ## Argument Reference @@ -55,4 +86,4 @@ In addition to all arguments above, the following attributes are exported: - `create` - (Default `10M`) - `delete` - (Default `10M`) - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_group_member.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_group_member.html.markdown index 614c940b015..c158055f0f7 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_group_member.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_group_member.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Multicast Group Member --- + + # Resource: aws_ec2_transit_gateway_multicast_group_member Registers members (network interfaces) with the transit gateway multicast group. @@ -13,12 +15,28 @@ A member is a network interface associated with a supported EC2 instance that re ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_multicast_group_member" "example" { - group_ip_address = "224.0.0.1" - network_interface_id = aws_network_interface.example.id - transit_gateway_multicast_domain_id = aws_ec2_transit_gateway_multicast_domain.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayMulticastGroupMember } from "./.gen/providers/aws/ec2-transit-gateway-multicast-group-member"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayMulticastGroupMember(this, "example", { + groupIpAddress: "224.0.0.1", + networkInterfaceId: Token.asString(awsNetworkInterfaceExample.id), + transitGatewayMulticastDomainId: Token.asString( + awsEc2TransitGatewayMulticastDomainExample.id + ), + }); + } } + ``` ## Argument Reference @@ -35,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - EC2 Transit Gateway Multicast Group Member identifier. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_group_source.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_group_source.html.markdown index 265105d03c8..1f3b479b19b 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_group_source.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_multicast_group_source.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Multicast Group Source --- + + # Resource: aws_ec2_transit_gateway_multicast_group_source Registers sources (network interfaces) with the transit gateway multicast group. @@ -13,12 +15,28 @@ A multicast source is a network interface attached to a supported instance that ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_multicast_group_source" "example" { - group_ip_address = "224.0.0.1" - network_interface_id = aws_network_interface.example.id - transit_gateway_multicast_domain_id = aws_ec2_transit_gateway_multicast_domain.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayMulticastGroupSource } from "./.gen/providers/aws/ec2-transit-gateway-multicast-group-source"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayMulticastGroupSource(this, "example", { + groupIpAddress: "224.0.0.1", + networkInterfaceId: Token.asString(awsNetworkInterfaceExample.id), + transitGatewayMulticastDomainId: Token.asString( + awsEc2TransitGatewayMulticastDomainExample.id + ), + }); + } } + ``` ## Argument Reference @@ -35,4 +53,4 @@ In addition to all arguments above, the following attributes are exported: * `id` - EC2 Transit Gateway Multicast Group Member identifier. - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_peering_attachment.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_peering_attachment.html.markdown index 5ac8ab0ffbd..82aed464de2 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_peering_attachment.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_peering_attachment.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Peering Attachment --- + + # Resource: aws_ec2_transit_gateway_peering_attachment Manages an EC2 Transit Gateway Peering Attachment. @@ -14,58 +16,54 @@ For examples of custom route table association and propagation, see the [EC2 Tra ## Example Usage ```typescript -import * as constructs from "constructs"; -import * as cdktf from "cdktf"; -/*Provider bindings are generated by running cdktf get. -See https://cdk.tf/provider-generation for more details.*/ -import * as aws from "./.gen/providers/aws"; -class MyConvertedCode extends cdktf.TerraformStack { - constructor(scope: constructs.Construct, name: string) { +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { Ec2TransitGateway } from "./.gen/providers/aws/ec2-transit-gateway"; +import { Ec2TransitGatewayPeeringAttachment } from "./.gen/providers/aws/ec2-transit-gateway-peering-attachment"; +import { AwsProvider } from "./.gen/providers/aws/provider"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { super(scope, name); - const awsLocal = new aws.provider.AwsProvider(this, "aws", { + const local = new AwsProvider(this, "aws", { alias: "local", region: "us-east-1", }); - const awsPeer = new aws.provider.AwsProvider(this, "aws_1", { + const peer = new AwsProvider(this, "aws_1", { alias: "peer", region: "us-west-2", }); - const awsEc2TransitGatewayLocal = - new aws.ec2TransitGateway.Ec2TransitGateway(this, "local", { - provider: awsLocal, - tags: { - Name: "Local TGW", - }, - }); - const awsEc2TransitGatewayPeer = - new aws.ec2TransitGateway.Ec2TransitGateway(this, "peer", { - provider: awsPeer, - tags: { - Name: "Peer TGW", - }, - }); - const dataAwsRegionPeer = new aws.dataAwsRegion.DataAwsRegion( - this, - "peer_4", - { - provider: awsPeer, - } - ); + const awsEc2TransitGatewayLocal = new Ec2TransitGateway(this, "local", { + provider: local, + tags: { + Name: "Local TGW", + }, + }); + const awsEc2TransitGatewayPeer = new Ec2TransitGateway(this, "peer", { + provider: peer, + tags: { + Name: "Peer TGW", + }, + }); + const dataAwsRegionPeer = new DataAwsRegion(this, "peer_4", { + provider: peer, + }); /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ dataAwsRegionPeer.overrideLogicalId("peer"); - new aws.ec2TransitGatewayPeeringAttachment.Ec2TransitGatewayPeeringAttachment( - this, - "example", - { - peerAccountId: cdktf.Token.asString(awsEc2TransitGatewayPeer.ownerId), - peerRegion: cdktf.Token.asString(dataAwsRegionPeer.name), - peerTransitGatewayId: cdktf.Token.asString(awsEc2TransitGatewayPeer.id), - tags: { - Name: "TGW Peering Requestor", - }, - transitGatewayId: cdktf.Token.asString(awsEc2TransitGatewayLocal.id), - } - ); + new Ec2TransitGatewayPeeringAttachment(this, "example", { + peerAccountId: Token.asString(awsEc2TransitGatewayPeer.ownerId), + peerRegion: Token.asString(dataAwsRegionPeer.name), + peerTransitGatewayId: Token.asString(awsEc2TransitGatewayPeer.id), + tags: { + Name: "TGW Peering Requestor", + }, + transitGatewayId: Token.asString(awsEc2TransitGatewayLocal.id), + }); } } @@ -100,4 +98,4 @@ terraform import aws_ec2_transit_gateway_peering_attachment.example tgw-attach-1 [1]: /docs/providers/aws/index.html - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_peering_attachment_accepter.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_peering_attachment_accepter.html.markdown index fb86c563aa0..d6f2e056cee 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_peering_attachment_accepter.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_peering_attachment_accepter.html.markdown @@ -6,20 +6,37 @@ description: |- Manages the accepter's side of an EC2 Transit Gateway peering Attachment --- + + # Resource: aws_ec2_transit_gateway_peering_attachment_accepter Manages the accepter's side of an EC2 Transit Gateway Peering Attachment. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_peering_attachment_accepter" "example" { - transit_gateway_attachment_id = aws_ec2_transit_gateway_peering_attachment.example.id - - tags = { - Name = "Example cross-account attachment" +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayPeeringAttachmentAccepter } from "./.gen/providers/aws/ec2-transit-gateway-peering-attachment-accepter"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayPeeringAttachmentAccepter(this, "example", { + tags: { + Name: "Example cross-account attachment", + }, + transitGatewayAttachmentId: Token.asString( + awsEc2TransitGatewayPeeringAttachmentExample.id + ), + }); } } + ``` A full example of how to create a Transit Gateway in one AWS account, share it with a second AWS account, and attach a to a Transit Gateway in the second account via the `awsEc2TransitGatewayPeeringAttachment` resource can be found in [the `/examples/transitGatewayCrossAccountPeeringAttachment` directory within the Github Repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/transit-gateway-cross-account-peering-attachment). @@ -49,4 +66,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_peering_attachment_accepter.example tgw-attach-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_policy_table.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_policy_table.html.markdown index 9e57efea412..c3a4f2c0614 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_policy_table.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_policy_table.html.markdown @@ -6,20 +6,35 @@ description: |- Manages an EC2 Transit Gateway Policy Table --- + + # Resource: aws_ec2_transit_gateway_policy_table Manages an EC2 Transit Gateway Policy Table. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_policy_table" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id - - tags = { - Name = "Example Policy Table" +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayPolicyTable } from "./.gen/providers/aws/ec2-transit-gateway-policy-table"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayPolicyTable(this, "example", { + tags: { + Name: "Example Policy Table", + }, + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + }); } } + ``` ## Argument Reference @@ -46,4 +61,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_policy_table.example tgw-rtb-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_policy_table_association.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_policy_table_association.html.markdown index f895a0e215c..2666dfc4601 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_policy_table_association.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_policy_table_association.html.markdown @@ -6,17 +6,37 @@ description: |- Manages an EC2 Transit Gateway Policy Table association --- + + # Resource: aws_ec2_transit_gateway_policy_table_association Manages an EC2 Transit Gateway Policy Table association. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_policy_table_association" "example" { - transit_gateway_attachment_id = aws_networkmanager_transit_gateway_peering.example.transit_gateway_peering_attachment_id - transit_gateway_policy_table_id = aws_ec2_transit_gateway_policy_table.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayPolicyTableAssociation } from "./.gen/providers/aws/ec2-transit-gateway-policy-table-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayPolicyTableAssociation(this, "example", { + transitGatewayAttachmentId: Token.asString( + awsNetworkmanagerTransitGatewayPeeringExample.transitGatewayPeeringAttachmentId + ), + transitGatewayPolicyTableId: Token.asString( + awsEc2TransitGatewayPolicyTableExample.id + ), + }); + } } + ``` ## Argument Reference @@ -42,4 +62,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_policy_table_association.example tgw-rtb-12345678_tgw-attach-87654321 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_prefix_list_reference.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_prefix_list_reference.html.markdown index 1b191a17c9d..41334b7583c 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_prefix_list_reference.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_prefix_list_reference.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Prefix List Reference --- + + # Resource: aws_ec2_transit_gateway_prefix_list_reference Manages an EC2 Transit Gateway Prefix List Reference. @@ -14,22 +16,56 @@ Manages an EC2 Transit Gateway Prefix List Reference. ### Attachment Routing -```terraform -resource "aws_ec2_transit_gateway_prefix_list_reference" "example" { - prefix_list_id = aws_ec2_managed_prefix_list.example.id - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway.example.association_default_route_table_id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayPrefixListReference } from "./.gen/providers/aws/ec2-transit-gateway-prefix-list-reference"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayPrefixListReference(this, "example", { + prefixListId: Token.asString(awsEc2ManagedPrefixListExample.id), + transitGatewayAttachmentId: Token.asString( + awsEc2TransitGatewayVpcAttachmentExample.id + ), + transitGatewayRouteTableId: Token.asString( + awsEc2TransitGatewayExample.associationDefaultRouteTableId + ), + }); + } } + ``` ### Blackhole Routing -```terraform -resource "aws_ec2_transit_gateway_prefix_list_reference" "example" { - blackhole = true - prefix_list_id = aws_ec2_managed_prefix_list.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway.example.association_default_route_table_id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayPrefixListReference } from "./.gen/providers/aws/ec2-transit-gateway-prefix-list-reference"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayPrefixListReference(this, "example", { + blackhole: true, + prefixListId: Token.asString(awsEc2ManagedPrefixListExample.id), + transitGatewayRouteTableId: Token.asString( + awsEc2TransitGatewayExample.associationDefaultRouteTableId + ), + }); + } } + ``` ## Argument Reference @@ -58,4 +94,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_prefix_list_reference.example tgw-rtb-12345678_pl-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_route.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_route.html.markdown index df3c812a24e..540ea2667d9 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_route.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_route.html.markdown @@ -6,6 +6,8 @@ description: |- Manages an EC2 Transit Gateway Route --- + + # Resource: aws_ec2_transit_gateway_route Manages an EC2 Transit Gateway Route. @@ -14,22 +16,56 @@ Manages an EC2 Transit Gateway Route. ### Standard usage -```terraform -resource "aws_ec2_transit_gateway_route" "example" { - destination_cidr_block = "0.0.0.0/0" - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway.example.association_default_route_table_id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayRoute } from "./.gen/providers/aws/ec2-transit-gateway-route"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayRoute(this, "example", { + destinationCidrBlock: "0.0.0.0/0", + transitGatewayAttachmentId: Token.asString( + awsEc2TransitGatewayVpcAttachmentExample.id + ), + transitGatewayRouteTableId: Token.asString( + awsEc2TransitGatewayExample.associationDefaultRouteTableId + ), + }); + } } + ``` ### Blackhole route -```terraform -resource "aws_ec2_transit_gateway_route" "example" { - destination_cidr_block = "0.0.0.0/0" - blackhole = true - transit_gateway_route_table_id = aws_ec2_transit_gateway.example.association_default_route_table_id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayRoute } from "./.gen/providers/aws/ec2-transit-gateway-route"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayRoute(this, "example", { + blackhole: true, + destinationCidrBlock: "0.0.0.0/0", + transitGatewayRouteTableId: Token.asString( + awsEc2TransitGatewayExample.associationDefaultRouteTableId + ), + }); + } } + ``` ## Argument Reference @@ -55,4 +91,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_route.example tgw-rtb-12345678_0.0.0.0/0 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table.html.markdown index 61103f6bd36..24ff115349a 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table.html.markdown @@ -6,16 +6,32 @@ description: |- Manages an EC2 Transit Gateway Route Table --- + + # Resource: aws_ec2_transit_gateway_route_table Manages an EC2 Transit Gateway Route Table. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_route_table" "example" { - transit_gateway_id = aws_ec2_transit_gateway.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayRouteTable } from "./.gen/providers/aws/ec2-transit-gateway-route-table"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayRouteTable(this, "example", { + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + }); + } } + ``` ## Argument Reference @@ -43,4 +59,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_route_table.example tgw-rtb-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table_association.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table_association.html.markdown index e8aa797c703..bb23e478ba0 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table_association.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table_association.html.markdown @@ -6,17 +6,37 @@ description: |- Manages an EC2 Transit Gateway Route Table association --- + + # Resource: aws_ec2_transit_gateway_route_table_association Manages an EC2 Transit Gateway Route Table association. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_route_table_association" "example" { - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayRouteTableAssociation } from "./.gen/providers/aws/ec2-transit-gateway-route-table-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayRouteTableAssociation(this, "example", { + transitGatewayAttachmentId: Token.asString( + awsEc2TransitGatewayVpcAttachmentExample.id + ), + transitGatewayRouteTableId: Token.asString( + awsEc2TransitGatewayRouteTableExample.id + ), + }); + } } + ``` ## Argument Reference @@ -25,6 +45,7 @@ The following arguments are supported: * `transitGatewayAttachmentId` - (Required) Identifier of EC2 Transit Gateway Attachment. * `transitGatewayRouteTableId` - (Required) Identifier of EC2 Transit Gateway Route Table. +* `replaceExistingAssociation` - (Optional) Boolean whether the Gateway Attachment should remove any current Route Table association before associating with the specified Route Table. Default value: `false`. This argument is intended for use with EC2 Transit Gateways shared into the current account, otherwise the `transitGatewayDefaultRouteTableAssociation` argument of the `awsEc2TransitGatewayVpcAttachment` resource should be used. ## Attributes Reference @@ -42,4 +63,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_route_table_association.example tgw-rtb-12345678_tgw-attach-87654321 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table_propagation.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table_propagation.html.markdown index 49921b2b128..a21b2f43903 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table_propagation.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_route_table_propagation.html.markdown @@ -6,17 +6,37 @@ description: |- Manages an EC2 Transit Gateway Route Table propagation --- + + # Resource: aws_ec2_transit_gateway_route_table_propagation Manages an EC2 Transit Gateway Route Table propagation. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_route_table_propagation" "example" { - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayRouteTablePropagation } from "./.gen/providers/aws/ec2-transit-gateway-route-table-propagation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayRouteTablePropagation(this, "example", { + transitGatewayAttachmentId: Token.asString( + awsEc2TransitGatewayVpcAttachmentExample.id + ), + transitGatewayRouteTableId: Token.asString( + awsEc2TransitGatewayRouteTableExample.id + ), + }); + } } + ``` ## Argument Reference @@ -42,4 +62,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_route_table_propagation.example tgw-rtb-12345678_tgw-attach-87654321 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_vpc_attachment.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_vpc_attachment.html.markdown index d188b741ff5..9d169f1d160 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_vpc_attachment.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_vpc_attachment.html.markdown @@ -6,18 +6,34 @@ description: |- Manages an EC2 Transit Gateway VPC Attachment --- + + # Resource: aws_ec2_transit_gateway_vpc_attachment Manages an EC2 Transit Gateway VPC Attachment. For examples of custom route table association and propagation, see the EC2 Transit Gateway Networking Examples Guide. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_vpc_attachment" "example" { - subnet_ids = [aws_subnet.example.id] - transit_gateway_id = aws_ec2_transit_gateway.example.id - vpc_id = aws_vpc.example.id +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayVpcAttachment } from "./.gen/providers/aws/ec2-transit-gateway-vpc-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayVpcAttachment(this, "example", { + subnetIds: [Token.asString(awsSubnetExample.id)], + transitGatewayId: Token.asString(awsEc2TransitGatewayExample.id), + vpcId: Token.asString(awsVpcExample.id), + }); + } } + ``` A full example of how to create a Transit Gateway in one AWS account, share it with a second AWS account, and attach a VPC in the second account to the Transit Gateway via the `awsEc2TransitGatewayVpcAttachment` and `awsEc2TransitGatewayVpcAttachmentAccepter` resources can be found in [the `/examples/transitGatewayCrossAccountVpcAttachment` directory within the Github Repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/transit-gateway-cross-account-vpc-attachment). @@ -52,4 +68,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_vpc_attachment.example tgw-attach-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown b/website/docs/cdktf/typescript/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown index 90fe5a37126..cdfd6c213d2 100644 --- a/website/docs/cdktf/typescript/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown +++ b/website/docs/cdktf/typescript/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown @@ -6,6 +6,8 @@ description: |- Manages the accepter's side of an EC2 Transit Gateway VPC Attachment --- + + # Resource: aws_ec2_transit_gateway_vpc_attachment_accepter Manages the accepter's side of an EC2 Transit Gateway VPC Attachment. @@ -18,14 +20,29 @@ connection into management. ## Example Usage -```terraform -resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "example" { - transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id - - tags = { - Name = "Example cross-account attachment" +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Ec2TransitGatewayVpcAttachmentAccepter } from "./.gen/providers/aws/ec2-transit-gateway-vpc-attachment-accepter"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Ec2TransitGatewayVpcAttachmentAccepter(this, "example", { + tags: { + Name: "Example cross-account attachment", + }, + transitGatewayAttachmentId: Token.asString( + awsEc2TransitGatewayVpcAttachmentExample.id + ), + }); } } + ``` A full example of how to create a Transit Gateway in one AWS account, share it with a second AWS account, and attach a VPC in the second account to the Transit Gateway via the `awsEc2TransitGatewayVpcAttachment` and `awsEc2TransitGatewayVpcAttachmentAccepter` resources can be found in [the `/examples/transitGatewayCrossAccountVpcAttachment` directory within the Github Repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/transit-gateway-cross-account-vpc-attachment). @@ -61,4 +78,4 @@ In addition to all arguments above, the following attributes are exported: $ terraform import aws_ec2_transit_gateway_vpc_attachment_accepter.example tgw-attach-12345678 ``` - \ No newline at end of file + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/eks_addon.html.markdown b/website/docs/cdktf/typescript/r/eks_addon.html.markdown new file mode 100644 index 00000000000..2c2be54b2b4 --- /dev/null +++ b/website/docs/cdktf/typescript/r/eks_addon.html.markdown @@ -0,0 +1,292 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_addon" +description: |- + Manages an EKS add-on +--- + + + +# Resource: aws_eks_addon + +Manages an EKS add-on. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksAddon } from "./.gen/providers/aws/eks-addon"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new EksAddon(this, "example", { + addonName: "vpc-cni", + clusterName: Token.asString(awsEksClusterExample.name), + }); + } +} + +``` + +## Example Update add-on usage with resolve_conflicts_on_update and PRESERVE + +`resolveConflictsOnUpdate` with `preserve` can be used to retain the config changes applied to the add-on with kubectl while upgrading to a newer version of the add-on. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksAddon } from "./.gen/providers/aws/eks-addon"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new EksAddon(this, "example", { + addonName: "coredns", + addonVersion: "v1.10.1-eksbuild.1", + clusterName: Token.asString(awsEksClusterExample.name), + resolveConflictsOnUpdate: "PRESERVE", + }); + } +} + +``` + +## Example add-on usage with custom configuration_values + +Custom add-on configuration can be passed using `configurationValues` as a single JSON string while creating or updating the add-on. + +~> **Note:** `configurationValues` is a single JSON string should match the valid JSON schema for each add-on with specific version. + +To find the correct JSON schema for each add-on can be extracted using [describe-addon-configuration](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-configuration.html) call. +This below is an example for extracting the `configurationValues` schema for `coredns`. + +```bash + aws eks describe-addon-configuration \ + --addon-name coredns \ + --addon-version v1.10.1-eksbuild.1 +``` + +Example to create a `coredns` managed addon with custom `configurationValues`. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksAddon } from "./.gen/providers/aws/eks-addon"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new EksAddon(this, "example", { + addonName: "coredns", + addonVersion: "v1.10.1-eksbuild.1", + clusterName: "mycluster", + configurationValues: Token.asString( + Fn.jsonencode({ + replicaCount: 4, + resources: { + limits: { + cpu: "100m", + memory: "150Mi", + }, + requests: { + cpu: "100m", + memory: "150Mi", + }, + }, + }) + ), + resolveConflictsOnCreate: "OVERWRITE", + }); + } +} + +``` + +### Example IAM Role for EKS Addon "vpc-cni" with AWS managed policy + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { propertyAccess, Token, Fn, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { EksCluster } from "./.gen/providers/aws/eks-cluster"; +import { IamOpenidConnectProvider } from "./.gen/providers/aws/iam-openid-connect-provider"; +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { IamRolePolicyAttachment } from "./.gen/providers/aws/iam-role-policy-attachment"; +import { DataTlsCertificate } from "./.gen/providers/tls/data-tls-certificate"; +interface MyConfig { + name: any; + roleArn: any; + vpcConfig: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: tls. + For a more precise conversion please use the --provider flag in convert.*/ + const example = new EksCluster(this, "example", { + name: config.name, + roleArn: config.roleArn, + vpcConfig: config.vpcConfig, + }); + const dataTlsCertificateExample = new DataTlsCertificate( + this, + "example_1", + { + url: propertyAccess(example.identity, ["0", "oidc", "0", "issuer"]), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataTlsCertificateExample.overrideLogicalId("example"); + const awsIamOpenidConnectProviderExample = new IamOpenidConnectProvider( + this, + "example_2", + { + clientIdList: ["sts.amazonaws.com"], + thumbprintList: [ + Token.asString( + propertyAccess(dataTlsCertificateExample.certificates, [ + "0", + "sha1_fingerprint", + ]) + ), + ], + url: Token.asString( + propertyAccess(example.identity, ["0", "oidc", "0", "issuer"]) + ), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsIamOpenidConnectProviderExample.overrideLogicalId("example"); + const exampleAssumeRolePolicy = new DataAwsIamPolicyDocument( + this, + "example_assume_role_policy", + { + statement: [ + { + actions: ["sts:AssumeRoleWithWebIdentity"], + condition: [ + { + test: "StringEquals", + values: ["system:serviceaccount:kube-system:aws-node"], + variable: + Token.asString( + Fn.replace( + Token.asString(awsIamOpenidConnectProviderExample.url), + "https://", + "" + ) + ) + ":sub", + }, + ], + effect: "Allow", + principals: [ + { + identifiers: [ + Token.asString(awsIamOpenidConnectProviderExample.arn), + ], + type: "Federated", + }, + ], + }, + ], + } + ); + const awsIamRoleExample = new IamRole(this, "example_4", { + assumeRolePolicy: Token.asString(exampleAssumeRolePolicy.json), + name: "example-vpc-cni-role", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsIamRoleExample.overrideLogicalId("example"); + const awsIamRolePolicyAttachmentExample = new IamRolePolicyAttachment( + this, + "example_5", + { + policyArn: "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", + role: Token.asString(awsIamRoleExample.name), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsIamRolePolicyAttachmentExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `addonName` – (Required) Name of the EKS add-on. The name must match one of + the names returned by [describe-addon-versions](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-versions.html). +* `clusterName` – (Required) Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). + +The following arguments are optional: + +* `addonVersion` – (Optional) The version of the EKS add-on. The version must + match one of the versions returned by [describe-addon-versions](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-versions.html). +* `configurationValues` - (Optional) custom configuration values for addons with single JSON string. This JSON string value must match the JSON schema derived from [describe-addon-configuration](https://docs.aws.amazon.com/cli/latest/reference/eks/describe-addon-configuration.html). +* `resolveConflictsOnCreate` - (Optional) How to resolve field value conflicts when migrating a self-managed add-on to an Amazon EKS add-on. Valid values are `none` and `overwrite`. For more details see the [CreateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_CreateAddon.html) API Docs. +* `resolveConflictsOnUpdate` - (Optional) How to resolve field value conflicts for an Amazon EKS add-on if you've changed a value from the Amazon EKS default value. Valid values are `none`, `overwrite`, and `preserve`. For more details see the [UpdateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) API Docs. +* `resolveConflicts` - (**Deprecated** use the `resolveConflictsOnCreate` and `resolveConflictsOnUpdate` attributes instead) Define how to resolve parameter value conflicts when migrating an existing add-on to an Amazon EKS add-on or when applying version updates to the add-on. Valid values are `none`, `overwrite` and `preserve`. Note that `preserve` is only valid on addon update, not for initial addon creation. If you need to set this to `preserve`, use the `resolveConflictsOnCreate` and `resolveConflictsOnUpdate` attributes instead. For more details check [UpdateAddon](https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) API Docs. +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `preserve` - (Optional) Indicates if you want to preserve the created resources when deleting the EKS add-on. +* `serviceAccountRoleArn` - (Optional) The Amazon Resource Name (ARN) of an + existing IAM role to bind to the add-on's service account. The role must be + assigned the IAM permissions required by the add-on. If you don't specify + an existing IAM role, then the add-on uses the permissions assigned to the node + IAM role. For more information, see [Amazon EKS node IAM role](https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html) + in the Amazon EKS User Guide. + + ~> **Note:** To specify an existing IAM role, you must have an IAM OpenID Connect (OIDC) + provider created for your cluster. For more information, [see Enabling IAM roles + for service accounts on your cluster](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html) + in the Amazon EKS User Guide. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the EKS add-on. +* `id` - EKS Cluster name and EKS Addon name separated by a colon (`:`). +* `status` - Status of the EKS add-on. +* `createdAt` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was created. +* `modifiedAt` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the EKS add-on was updated. +* `tagsAll` - (Optional) Key-value map of resource tags, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `20M`) +* `update` - (Default `20M`) +* `delete` - (Default `40M`) + +## Import + +EKS add-on can be imported using the `clusterName` and `addonName` separated by a colon (`:`), e.g., + +``` +$ terraform import aws_eks_addon.my_eks_addon my_cluster_name:my_addon_name +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/eks_cluster.html.markdown b/website/docs/cdktf/typescript/r/eks_cluster.html.markdown new file mode 100644 index 00000000000..b7a129b45f6 --- /dev/null +++ b/website/docs/cdktf/typescript/r/eks_cluster.html.markdown @@ -0,0 +1,424 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_cluster" +description: |- + Manages an EKS Cluster +--- + + + +# Resource: aws_eks_cluster + +Manages an EKS Cluster. + +> **Hands-on:** For an example of `awsEksCluster` in use, follow the [Provision an EKS Cluster](https://learn.hashicorp.com/tutorials/terraform/eks) tutorial on HashiCorp Learn. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformOutput, propertyAccess, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksCluster } from "./.gen/providers/aws/eks-cluster"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new EksCluster(this, "example", { + dependsOn: [ + exampleAmazonEksClusterPolicy, + exampleAmazonEksvpcResourceController, + ], + name: "example", + roleArn: Token.asString(awsIamRoleExample.arn), + vpcConfig: { + subnetIds: [example1.id, example2.id], + }, + }); + new TerraformOutput(this, "endpoint", { + value: example.endpoint, + }); + new TerraformOutput(this, "kubeconfig-certificate-authority-data", { + value: propertyAccess(example.certificateAuthority, ["0", "data"]), + }); + } +} + +``` + +### Example IAM Role for EKS Cluster + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { IamRolePolicyAttachment } from "./.gen/providers/aws/iam-role-policy-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const assumeRole = new DataAwsIamPolicyDocument(this, "assume_role", { + statement: [ + { + actions: ["sts:AssumeRole"], + effect: "Allow", + principals: [ + { + identifiers: ["eks.amazonaws.com"], + type: "Service", + }, + ], + }, + ], + }); + const example = new IamRole(this, "example", { + assumeRolePolicy: Token.asString(assumeRole.json), + name: "eks-cluster-example", + }); + new IamRolePolicyAttachment(this, "example-AmazonEKSClusterPolicy", { + policyArn: "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy", + role: example.name, + }); + new IamRolePolicyAttachment( + this, + "example-AmazonEKSVPCResourceController", + { + policyArn: "arn:aws:iam::aws:policy/AmazonEKSVPCResourceController", + role: example.name, + } + ); + } +} + +``` + +### Enabling Control Plane Logging + +[EKS Control Plane Logging](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) can be enabled via the `enabledClusterLogTypes` argument. To manage the CloudWatch Log Group retention period, the [`awsCloudwatchLogGroup` resource](/docs/providers/aws/r/cloudwatch_log_group.html) can be used. + +-> The below configuration uses [`dependsOn`](https://www.terraform.io/docs/configuration/meta-arguments/depends_on.html) to prevent ordering issues with EKS automatically creating the log group first and a variable for naming consistency. Other ordering and naming methodologies may be more appropriate for your environment. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { VariableType, TerraformVariable, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { CloudwatchLogGroup } from "./.gen/providers/aws/cloudwatch-log-group"; +import { EksCluster } from "./.gen/providers/aws/eks-cluster"; +interface MyConfig { + roleArn: any; + vpcConfig: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + You can read more about this at https://cdk.tf/variables*/ + const clusterName = new TerraformVariable(this, "cluster_name", { + default: "example", + type: VariableType.STRING, + }); + const example = new CloudwatchLogGroup(this, "example", { + name: "/aws/eks/${" + clusterName.value + "}/cluster", + retentionInDays: 7, + }); + const awsEksClusterExample = new EksCluster(this, "example_2", { + dependsOn: [example], + enabledClusterLogTypes: ["api", "audit"], + name: clusterName.stringValue, + roleArn: config.roleArn, + vpcConfig: config.vpcConfig, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsEksClusterExample.overrideLogicalId("example"); + } +} + +``` + +### Enabling IAM Roles for Service Accounts + +Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For more information about this feature, see the [EKS User Guide](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html). + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { propertyAccess, Token, Fn, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { EksCluster } from "./.gen/providers/aws/eks-cluster"; +import { IamOpenidConnectProvider } from "./.gen/providers/aws/iam-openid-connect-provider"; +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { DataTlsCertificate } from "./.gen/providers/tls/data-tls-certificate"; +interface MyConfig { + name: any; + roleArn: any; + vpcConfig: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: tls. + For a more precise conversion please use the --provider flag in convert.*/ + const example = new EksCluster(this, "example", { + name: config.name, + roleArn: config.roleArn, + vpcConfig: config.vpcConfig, + }); + const dataTlsCertificateExample = new DataTlsCertificate( + this, + "example_1", + { + url: propertyAccess(example.identity, ["0", "oidc", "0", "issuer"]), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataTlsCertificateExample.overrideLogicalId("example"); + const awsIamOpenidConnectProviderExample = new IamOpenidConnectProvider( + this, + "example_2", + { + clientIdList: ["sts.amazonaws.com"], + thumbprintList: Token.asList( + propertyAccess(dataTlsCertificateExample.certificates, [ + "*", + "sha1_fingerprint", + ]) + ), + url: Token.asString(dataTlsCertificateExample.url), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsIamOpenidConnectProviderExample.overrideLogicalId("example"); + const exampleAssumeRolePolicy = new DataAwsIamPolicyDocument( + this, + "example_assume_role_policy", + { + statement: [ + { + actions: ["sts:AssumeRoleWithWebIdentity"], + condition: [ + { + test: "StringEquals", + values: ["system:serviceaccount:kube-system:aws-node"], + variable: + Token.asString( + Fn.replace( + Token.asString(awsIamOpenidConnectProviderExample.url), + "https://", + "" + ) + ) + ":sub", + }, + ], + effect: "Allow", + principals: [ + { + identifiers: [ + Token.asString(awsIamOpenidConnectProviderExample.arn), + ], + type: "Federated", + }, + ], + }, + ], + } + ); + const awsIamRoleExample = new IamRole(this, "example_4", { + assumeRolePolicy: Token.asString(exampleAssumeRolePolicy.json), + name: "example", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsIamRoleExample.overrideLogicalId("example"); + } +} + +``` + +### EKS Cluster on AWS Outpost + +[Creating a local Amazon EKS cluster on an AWS Outpost](https://docs.aws.amazon.com/eks/latest/userguide/create-cluster-outpost.html) + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksCluster } from "./.gen/providers/aws/eks-cluster"; +import { IamRole } from "./.gen/providers/aws/iam-role"; +interface MyConfig { + subnetIds: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + const example = new IamRole(this, "example", { + assumeRolePolicy: Token.asString(exampleAssumeRolePolicy.json), + name: "example", + }); + const awsEksClusterExample = new EksCluster(this, "example_1", { + name: "example-cluster", + outpostConfig: { + controlPlaneInstanceType: "m5d.large", + outpostArns: [Token.asString(dataAwsOutpostsOutpostExample.arn)], + }, + roleArn: example.arn, + vpcConfig: { + endpointPrivateAccess: true, + endpointPublicAccess: false, + subnetIds: config.subnetIds, + }, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsEksClusterExample.overrideLogicalId("example"); + } +} + +``` + +After adding inline IAM Policies (e.g., [`awsIamRolePolicy` resource](/docs/providers/aws/r/iam_role_policy.html)) or attaching IAM Policies (e.g., [`awsIamPolicy` resource](/docs/providers/aws/r/iam_policy.html) and [`awsIamRolePolicyAttachment` resource](/docs/providers/aws/r/iam_role_policy_attachment.html)) with the desired permissions to the IAM Role, annotate the Kubernetes service account (e.g., [`kubernetesServiceAccount` resource](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account)) and recreate any pods. + +## Argument Reference + +The following arguments are required: + +* `name` – (Required) Name of the cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). +* `roleArn` - (Required) ARN of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. Ensure the resource configuration includes explicit dependencies on the IAM Role permissions by adding [`dependsOn`](https://www.terraform.io/docs/configuration/meta-arguments/depends_on.html) if using the [`awsIamRolePolicy` resource](/docs/providers/aws/r/iam_role_policy.html) or [`awsIamRolePolicyAttachment` resource](/docs/providers/aws/r/iam_role_policy_attachment.html), otherwise EKS cannot delete EKS managed EC2 infrastructure such as Security Groups on EKS Cluster deletion. +* `vpcConfig` - (Required) Configuration block for the VPC associated with your cluster. Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see [Cluster VPC Considerations](https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) and [Cluster Security Group Considerations](https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) in the Amazon EKS User Guide. Detailed below. Also contains attributes detailed in the Attributes section. + +The following arguments are optional: + +* `enabledClusterLogTypes` - (Optional) List of the desired control plane logging to enable. For more information, see [Amazon EKS Control Plane Logging](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html). +* `encryptionConfig` - (Optional) Configuration block with encryption configuration for the cluster. Only available on Kubernetes 1.13 and above clusters created after March 6, 2020. Detailed below. +* `kubernetesNetworkConfig` - (Optional) Configuration block with kubernetes network configuration for the cluster. Detailed below. If removed, Terraform will only perform drift detection if a configuration value is provided. +* `outpostConfig` - (Optional) Configuration block representing the configuration of your local Amazon EKS cluster on an AWS Outpost. This block isn't available for creating Amazon EKS clusters on the AWS cloud. +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `version` – (Optional) Desired Kubernetes master version. If you do not specify a value, the latest available version at resource creation is used and no upgrades will occur except those automatically triggered by EKS. The value must be configured and increased to upgrade the version when desired. Downgrades are not supported by EKS. + +### encryption_config + +The following arguments are supported in the `encryptionConfig` configuration block: + +* `provider` - (Required) Configuration block with provider for encryption. Detailed below. +* `resources` - (Required) List of strings with resources to be encrypted. Valid values: `secrets`. + +#### provider + +The following arguments are supported in the `provider` configuration block: + +* `keyArn` - (Required) ARN of the Key Management Service (KMS) customer master key (CMK). The CMK must be symmetric, created in the same region as the cluster, and if the CMK was created in a different account, the user must have access to the CMK. For more information, see [Allowing Users in Other Accounts to Use a CMK in the AWS Key Management Service Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying-external-accounts.html). + +### vpc_config Arguments + +* `endpointPrivateAccess` - (Optional) Whether the Amazon EKS private API server endpoint is enabled. Default is `false`. +* `endpointPublicAccess` - (Optional) Whether the Amazon EKS public API server endpoint is enabled. Default is `true`. +* `publicAccessCidrs` - (Optional) List of CIDR blocks. Indicates which CIDR blocks can access the Amazon EKS public API server endpoint when enabled. EKS defaults this to a list with `0000/0`. Terraform will only perform drift detection of its value when present in a configuration. +* `securityGroupIds` – (Optional) List of security group IDs for the cross-account elastic network interfaces that Amazon EKS creates to use to allow communication between your worker nodes and the Kubernetes control plane. +* `subnetIds` – (Required) List of subnet IDs. Must be in at least two different availability zones. Amazon EKS creates cross-account elastic network interfaces in these subnets to allow communication between your worker nodes and the Kubernetes control plane. + +### kubernetes_network_config + +The following arguments are supported in the `kubernetesNetworkConfig` configuration block: + +* `serviceIpv4Cidr` - (Optional) The CIDR block to assign Kubernetes pod and service IP addresses from. If you don't specify a block, Kubernetes assigns addresses from either the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks. We recommend that you specify a block that does not overlap with resources in other networks that are peered or connected to your VPC. You can only specify a custom CIDR block when you create a cluster, changing this value will force a new cluster to be created. The block must meet the following requirements: + + * Within one of the following private IP address blocks: 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16. + + * Doesn't overlap with any CIDR block assigned to the VPC that you selected for VPC. + + * Between /24 and /12. +* `ipFamily` - (Optional) The IP family used to assign Kubernetes pod and service addresses. Valid values are `ipv4` (default) and `ipv6`. You can only specify an IP family when you create a cluster, changing this value will force a new cluster to be created. + +### outpost_config + +The following arguments are supported in the `outpostConfig` configuration block: + +* `controlPlaneInstanceType` - (Required) The Amazon EC2 instance type that you want to use for your local Amazon EKS cluster on Outposts. The instance type that you specify is used for all Kubernetes control plane instances. The instance type can't be changed after cluster creation. Choose an instance type based on the number of nodes that your cluster will have. If your cluster will have: + + * 1–20 nodes, then we recommend specifying a large instance type. + + * 21–100 nodes, then we recommend specifying an xlarge instance type. + + * 101–250 nodes, then we recommend specifying a 2xlarge instance type. + + For a list of the available Amazon EC2 instance types, see Compute and storage in AWS Outposts rack features The control plane is not automatically scaled by Amazon EKS. + +* `controlPlanePlacement` - (Optional) An object representing the placement configuration for all the control plane instances of your local Amazon EKS cluster on AWS Outpost. +The following arguments are supported in the `controlPlanePlacement` configuration block: + + * `groupName` - (Required) The name of the placement group for the Kubernetes control plane instances. This setting can't be changed after cluster creation. + +* `outpostArns` - (Required) The ARN of the Outpost that you want to use for your local Amazon EKS cluster on Outposts. This argument is a list of arns, but only a single Outpost ARN is supported currently. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the cluster. +* `certificateAuthority` - Attribute block containing `certificateAuthorityData` for your cluster. Detailed below. +* `clusterId` - The ID of your local Amazon EKS cluster on the AWS Outpost. This attribute isn't available for an AWS EKS cluster on AWS cloud. +* `createdAt` - Unix epoch timestamp in seconds for when the cluster was created. +* `endpoint` - Endpoint for your Kubernetes API server. +* `id` - Name of the cluster. +* `identity` - Attribute block containing identity provider information for your cluster. Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. Detailed below. +* `kubernetesNetworkConfigServiceIpv6Cidr` - The CIDR block that Kubernetes pod and service IP addresses are assigned from if you specified `ipv6` for ipFamily when you created the cluster. Kubernetes assigns service addresses from the unique local address range (fc00::/7) because you can't specify a custom IPv6 CIDR block when you create the cluster. +* `platformVersion` - Platform version for the cluster. +* `status` - Status of the EKS cluster. One of `creating`, `active`, `deleting`, `failed`. +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `vpcConfig` - Configuration block _argument_ that also includes attributes for the VPC associated with your cluster. Detailed below. + +### certificate_authority + +* `data` - Base64 encoded certificate data required to communicate with your cluster. Add this to the `certificateAuthorityData` section of the `kubeconfig` file for your cluster. + +### identity + +* `oidc` - Nested block containing [OpenID Connect](https://openid.net/connect/) identity provider information for the cluster. Detailed below. + +### oidc + +* `issuer` - Issuer URL for the OpenID Connect identity provider. + +### vpc_config Attributes + +* `clusterSecurityGroupId` - Cluster security group that was created by Amazon EKS for the cluster. Managed node groups use this security group for control-plane-to-data-plane communication. +* `vpcId` - ID of the VPC associated with your cluster. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `30M`) +* `update` - (Default `60M`) +Note that the `update` timeout is used separately for both `version` and `vpcConfig` update timeouts. +* `delete` - (Default `15M`) + +## Import + +EKS Clusters can be imported using the `name`, e.g., + +``` +$ terraform import aws_eks_cluster.my_cluster my_cluster +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/eks_fargate_profile.html.markdown b/website/docs/cdktf/typescript/r/eks_fargate_profile.html.markdown new file mode 100644 index 00000000000..9a33a402e8f --- /dev/null +++ b/website/docs/cdktf/typescript/r/eks_fargate_profile.html.markdown @@ -0,0 +1,139 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_fargate_profile" +description: |- + Manages an EKS Fargate Profile +--- + + + +# Resource: aws_eks_fargate_profile + +Manages an EKS Fargate Profile. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, propertyAccess, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksFargateProfile } from "./.gen/providers/aws/eks-fargate-profile"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new EksFargateProfile(this, "example", { + clusterName: Token.asString(awsEksClusterExample.name), + fargateProfileName: "example", + podExecutionRoleArn: Token.asString(awsIamRoleExample.arn), + selector: [ + { + namespace: "example", + }, + ], + subnetIds: Token.asList(propertyAccess(awsSubnetExample, ["*", "id"])), + }); + } +} + +``` + +### Example IAM Role for EKS Fargate Profile + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { IamRolePolicyAttachment } from "./.gen/providers/aws/iam-role-policy-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new IamRole(this, "example", { + assumeRolePolicy: Token.asString( + Fn.jsonencode({ + Statement: [ + { + Action: "sts:AssumeRole", + Effect: "Allow", + Principal: { + Service: "eks-fargate-pods.amazonaws.com", + }, + }, + ], + Version: "2012-10-17", + }) + ), + name: "eks-fargate-profile-example", + }); + new IamRolePolicyAttachment( + this, + "example-AmazonEKSFargatePodExecutionRolePolicy", + { + policyArn: + "arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy", + role: example.name, + } + ); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `clusterName` – (Required) Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). +* `fargateProfileName` – (Required) Name of the EKS Fargate Profile. +* `podExecutionRoleArn` – (Required) Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Fargate Profile. +* `selector` - (Required) Configuration block(s) for selecting Kubernetes Pods to execute with this EKS Fargate Profile. Detailed below. +* `subnetIds` – (Required) Identifiers of private EC2 Subnets to associate with the EKS Fargate Profile. These subnets must have the following resource tag: `kubernetesIo/cluster/clusterName` (where `clusterName` is replaced with the name of the EKS Cluster). + +The following arguments are optional: + +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### selector Configuration Block + +The following arguments are required: + +* `namespace` - (Required) Kubernetes namespace for selection. + +The following arguments are optional: + +* `labels` - (Optional) Key-value map of Kubernetes labels for selection. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the EKS Fargate Profile. +* `id` - EKS Cluster name and EKS Fargate Profile name separated by a colon (`:`). +* `status` - Status of the EKS Fargate Profile. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `10M`) +* `delete` - (Default `10M`) + +## Import + +EKS Fargate Profiles can be imported using the `clusterName` and `fargateProfileName` separated by a colon (`:`), e.g., + +``` +$ terraform import aws_eks_fargate_profile.my_fargate_profile my_cluster:my_fargate_profile +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/eks_identity_provider_config.html.markdown b/website/docs/cdktf/typescript/r/eks_identity_provider_config.html.markdown new file mode 100644 index 00000000000..781fdfaefd7 --- /dev/null +++ b/website/docs/cdktf/typescript/r/eks_identity_provider_config.html.markdown @@ -0,0 +1,85 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_identity_provider_config" +description: |- + Manages an EKS Identity Provider Configuration. +--- + + + +# Resource: aws_eks_identity_provider_config + +Manages an EKS Identity Provider Configuration. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksIdentityProviderConfig } from "./.gen/providers/aws/eks-identity-provider-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new EksIdentityProviderConfig(this, "example", { + clusterName: Token.asString(awsEksClusterExample.name), + oidc: { + clientId: "your client_id", + identityProviderConfigName: "example", + issuerUrl: "your issuer_url", + }, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `clusterName` – (Required) Name of the EKS Cluster. +* `oidc` - (Required) Nested attribute containing [OpenID Connect](https://openid.net/connect/) identity provider information for the cluster. Detailed below. +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### oidc Configuration Block + +* `clientId` – (Required) Client ID for the OpenID Connect identity provider. +* `groupsClaim` - (Optional) The JWT claim that the provider will use to return groups. +* `groupsPrefix` - (Optional) A prefix that is prepended to group claims e.g., `oidc:`. +* `identityProviderConfigName` – (Required) The name of the identity provider config. +* `issuerUrl` - (Required) Issuer URL for the OpenID Connect identity provider. +* `requiredClaims` - (Optional) The key value pairs that describe required claims in the identity token. +* `usernameClaim` - (Optional) The JWT claim that the provider will use as the username. +* `usernamePrefix` - (Optional) A prefix that is prepended to username claims. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the EKS Identity Provider Configuration. +* `id` - EKS Cluster name and EKS Identity Provider Configuration name separated by a colon (`:`). +* `status` - Status of the EKS Identity Provider Configuration. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `40M`) +* `delete` - (Default `40M`) + +## Import + +EKS Identity Provider Configurations can be imported using the `clusterName` and `identityProviderConfigName` separated by a colon (`:`), e.g., + +``` +$ terraform import aws_eks_identity_provider_config.my_identity_provider_config my_cluster:my_identity_provider_config +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/eks_node_group.html.markdown b/website/docs/cdktf/typescript/r/eks_node_group.html.markdown new file mode 100644 index 00000000000..9ce32ff882d --- /dev/null +++ b/website/docs/cdktf/typescript/r/eks_node_group.html.markdown @@ -0,0 +1,329 @@ +--- +subcategory: "EKS (Elastic Kubernetes)" +layout: "aws" +page_title: "AWS: aws_eks_node_group" +description: |- + Manages an EKS Node Group +--- + + + +# Resource: aws_eks_node_group + +Manages an EKS Node Group, which can provision and optionally update an Auto Scaling Group of Kubernetes worker nodes compatible with EKS. Additional documentation about this functionality can be found in the [EKS User Guide](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html). + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, propertyAccess, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksNodeGroup } from "./.gen/providers/aws/eks-node-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new EksNodeGroup(this, "example", { + clusterName: Token.asString(awsEksClusterExample.name), + dependsOn: [ + exampleAmazonEksWorkerNodePolicy, + exampleAmazonEksCniPolicy, + exampleAmazonEc2ContainerRegistryReadOnly, + ], + nodeGroupName: "example", + nodeRoleArn: Token.asString(awsIamRoleExample.arn), + scalingConfig: { + desiredSize: 1, + maxSize: 2, + minSize: 1, + }, + subnetIds: Token.asList(propertyAccess(awsSubnetExample, ["*", "id"])), + updateConfig: { + maxUnavailable: 1, + }, + }); + } +} + +``` + +### Ignoring Changes to Desired Size + +You can utilize the generic Terraform resource [lifecycle configuration block](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html) with `ignoreChanges` to create an EKS Node Group with an initial size of running instances, then ignore any changes to that count caused externally (e.g., Application Autoscaling). + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EksNodeGroup } from "./.gen/providers/aws/eks-node-group"; +interface MyConfig { + maxSize: any; + minSize: any; + clusterName: any; + nodeRoleArn: any; + subnetIds: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + new EksNodeGroup(this, "example", { + lifecycle: { + ignoreChanges: [d0.desiredSize], + }, + scalingConfig: { + desiredSize: 2, + maxSize: config.maxSize, + minSize: config.minSize, + }, + clusterName: config.clusterName, + nodeRoleArn: config.nodeRoleArn, + subnetIds: config.subnetIds, + }); + } +} + +``` + +### Tracking the latest EKS Node Group AMI releases + +You can have the node group track the latest version of the Amazon EKS optimized Amazon Linux AMI for a given EKS version by querying an Amazon provided SSM parameter. Replace `amazonLinux2` in the parameter name below with `amazonLinux2Gpu` to retrieve the accelerated AMI version and `amazonLinux2Arm64` to retrieve the Arm version. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, Fn, propertyAccess, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsSsmParameter } from "./.gen/providers/aws/data-aws-ssm-parameter"; +import { EksNodeGroup } from "./.gen/providers/aws/eks-node-group"; +interface MyConfig { + scalingConfig: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + const eksAmiReleaseVersion = new DataAwsSsmParameter( + this, + "eks_ami_release_version", + { + name: + "/aws/service/eks/optimized-ami/${" + + example.version + + "}/amazon-linux-2/recommended/release_version", + } + ); + new EksNodeGroup(this, "example", { + clusterName: example.name, + nodeGroupName: "example", + nodeRoleArn: Token.asString(awsIamRoleExample.arn), + releaseVersion: Token.asString( + Fn.nonsensitive(eksAmiReleaseVersion.value) + ), + subnetIds: Token.asList(propertyAccess(awsSubnetExample, ["*", "id"])), + version: example.version, + scalingConfig: config.scalingConfig, + }); + } +} + +``` + +### Example IAM Role for EKS Node Group + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { IamRolePolicyAttachment } from "./.gen/providers/aws/iam-role-policy-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new IamRole(this, "example", { + assumeRolePolicy: Token.asString( + Fn.jsonencode({ + Statement: [ + { + Action: "sts:AssumeRole", + Effect: "Allow", + Principal: { + Service: "ec2.amazonaws.com", + }, + }, + ], + Version: "2012-10-17", + }) + ), + name: "eks-node-group-example", + }); + new IamRolePolicyAttachment( + this, + "example-AmazonEC2ContainerRegistryReadOnly", + { + policyArn: "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", + role: example.name, + } + ); + new IamRolePolicyAttachment(this, "example-AmazonEKSWorkerNodePolicy", { + policyArn: "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", + role: example.name, + }); + new IamRolePolicyAttachment(this, "example-AmazonEKS_CNI_Policy", { + policyArn: "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", + role: example.name, + }); + } +} + +``` + +### Example Subnets for EKS Node Group + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + Token, + TerraformCount, + propertyAccess, + Fn, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsAvailabilityZones } from "./.gen/providers/aws/data-aws-availability-zones"; +import { Subnet } from "./.gen/providers/aws/subnet"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const available = new DataAwsAvailabilityZones(this, "available", { + state: "available", + }); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const exampleCount = TerraformCount.of(Token.asNumber("2")); + new Subnet(this, "example", { + availabilityZone: Token.asString( + propertyAccess(available.names, [exampleCount.index]) + ), + cidrBlock: Token.asString( + Fn.cidrsubnet( + Token.asString(awsVpcExample.cidrBlock), + 8, + Token.asNumber(exampleCount.index) + ) + ), + vpcId: Token.asString(awsVpcExample.id), + count: exampleCount, + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `clusterName` – (Required) Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (`^[0-9A-Za-z][A-Za-z0-9\-_]+$`). +* `nodeRoleArn` – (Required) Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group. +* `scalingConfig` - (Required) Configuration block with scaling settings. See [`scalingConfig`](#scaling_config-configuration-block) below for details. +* `subnetIds` – (Required) Identifiers of EC2 Subnets to associate with the EKS Node Group. + +The following arguments are optional: + +* `amiType` - (Optional) Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values. Terraform will only perform drift detection if a configuration value is provided. +* `capacityType` - (Optional) Type of capacity associated with the EKS Node Group. Valid values: `onDemand`, `spot`. Terraform will only perform drift detection if a configuration value is provided. +* `diskSize` - (Optional) Disk size in GiB for worker nodes. Defaults to `50` for Windows, `20` all other node groups. Terraform will only perform drift detection if a configuration value is provided. +* `forceUpdateVersion` - (Optional) Force version update if existing pods are unable to be drained due to a pod disruption budget issue. +* `instanceTypes` - (Optional) List of instance types associated with the EKS Node Group. Defaults to `["t3Medium"]`. Terraform will only perform drift detection if a configuration value is provided. +* `labels` - (Optional) Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed. +* `launchTemplate` - (Optional) Configuration block with Launch Template settings. See [`launchTemplate`](#launch_template-configuration-block) below for details. +* `nodeGroupName` – (Optional) Name of the EKS Node Group. If omitted, Terraform will assign a random, unique name. Conflicts with `nodeGroupNamePrefix`. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters. +* `nodeGroupNamePrefix` – (Optional) Creates a unique name beginning with the specified prefix. Conflicts with `nodeGroupName`. +* `releaseVersion` – (Optional) AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version. +* `remoteAccess` - (Optional) Configuration block with remote access settings. See [`remoteAccess`](#remote_access-configuration-block) below for details. +* `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `taint` - (Optional) The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. See [taint](#taint-configuration-block) below for details. +* `updateConfig` - (Optional) Configuration block with update settings. See [`updateConfig`](#update_config-configuration-block) below for details. +* `version` – (Optional) Kubernetes version. Defaults to EKS Cluster Kubernetes version. Terraform will only perform drift detection if a configuration value is provided. + +### launch_template Configuration Block + +~> **NOTE:** Either `id` or `name` must be specified. + +* `id` - (Optional) Identifier of the EC2 Launch Template. Conflicts with `name`. +* `name` - (Optional) Name of the EC2 Launch Template. Conflicts with `id`. +* `version` - (Required) EC2 Launch Template version number. While the API accepts values like `$default` and `$latest`, the API will convert the value to the associated version number (e.g., `1`) on read and Terraform will show a difference on next plan. Using the `defaultVersion` or `latestVersion` attribute of the `awsLaunchTemplate` resource or data source is recommended for this argument. + +### remote_access Configuration Block + +* `ec2SshKey` - (Optional) EC2 Key Pair name that provides access for remote communication with the worker nodes in the EKS Node Group. If you specify this configuration, but do not specify `sourceSecurityGroupIds` when you create an EKS Node Group, either port 3389 for Windows, or port 22 for all other operating systems is opened on the worker nodes to the Internet (0.0.0.0/0). For Windows nodes, this will allow you to use RDP, for all others this allows you to SSH into the worker nodes. +* `sourceSecurityGroupIds` - (Optional) Set of EC2 Security Group IDs to allow SSH access (port 22) from on the worker nodes. If you specify `ec2SshKey`, but do not specify this configuration when you create an EKS Node Group, port 22 on the worker nodes is opened to the Internet (0.0.0.0/0). + +### scaling_config Configuration Block + +* `desiredSize` - (Required) Desired number of worker nodes. +* `maxSize` - (Required) Maximum number of worker nodes. +* `minSize` - (Required) Minimum number of worker nodes. + +### taint Configuration Block + +* `key` - (Required) The key of the taint. Maximum length of 63. +* `value` - (Optional) The value of the taint. Maximum length of 63. +* `effect` - (Required) The effect of the taint. Valid values: `noSchedule`, `noExecute`, `preferNoSchedule`. + +### update_config Configuration Block + +The following arguments are mutually exclusive. + +* `maxUnavailable` - (Optional) Desired max number of unavailable worker nodes during node group update. +* `maxUnavailablePercentage` - (Optional) Desired max percentage of unavailable worker nodes during node group update. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the EKS Node Group. +* `id` - EKS Cluster name and EKS Node Group name separated by a colon (`:`). +* `resources` - List of objects containing information about underlying resources. + * `autoscalingGroups` - List of objects containing information about AutoScaling Groups. + * `name` - Name of the AutoScaling Group. + * `remoteAccessSecurityGroupId` - Identifier of the remote access EC2 Security Group. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `status` - Status of the EKS Node Group. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `60M`) +* `update` - (Default `60M`) +* `delete` - (Default `60M`) + +## Import + +EKS Node Groups can be imported using the `clusterName` and `nodeGroupName` separated by a colon (`:`), e.g., + +``` +$ terraform import aws_eks_node_group.my_node_group my_cluster:my_node_group +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/instance.html.markdown b/website/docs/cdktf/typescript/r/instance.html.markdown new file mode 100644 index 00000000000..21955fee960 --- /dev/null +++ b/website/docs/cdktf/typescript/r/instance.html.markdown @@ -0,0 +1,527 @@ +--- +subcategory: "EC2 (Elastic Compute Cloud)" +layout: "aws" +page_title: "AWS: aws_instance" +description: |- + Provides an EC2 instance resource. This allows instances to be created, updated, and deleted. Instances also support provisioning. +--- + + + +# Resource: aws_instance + +Provides an EC2 instance resource. This allows instances to be created, updated, and deleted. Instances also support [provisioning](https://www.terraform.io/docs/provisioners/index.html). + +## Example Usage + +### Basic example using AMI lookup + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsAmi } from "./.gen/providers/aws/data-aws-ami"; +import { Instance } from "./.gen/providers/aws/instance"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const ubuntu = new DataAwsAmi(this, "ubuntu", { + filter: [ + { + name: "name", + values: ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"], + }, + { + name: "virtualization-type", + values: ["hvm"], + }, + ], + mostRecent: true, + owners: ["099720109477"], + }); + new Instance(this, "web", { + ami: Token.asString(ubuntu.id), + instanceType: "t3.micro", + tags: { + Name: "HelloWorld", + }, + }); + } +} + +``` + +### Spot instance example + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsAmi } from "./.gen/providers/aws/data-aws-ami"; +import { Instance } from "./.gen/providers/aws/instance"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const thisVar = new DataAwsAmi(this, "this", { + filter: [ + { + name: "architecture", + values: ["arm64"], + }, + { + name: "name", + values: ["al2023-ami-2023*"], + }, + ], + mostRecent: true, + owners: ["amazon"], + }); + const awsInstanceThis = new Instance(this, "this_1", { + ami: Token.asString(thisVar.id), + instanceMarketOptions: { + spotOptions: { + maxPrice: Token.asString(0.0031), + }, + }, + instanceType: "t4g.nano", + tags: { + Name: "test-spot", + }, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsInstanceThis.overrideLogicalId("this"); + } +} + +``` + +### Network and credit specification example + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Instance } from "./.gen/providers/aws/instance"; +import { NetworkInterface } from "./.gen/providers/aws/network-interface"; +import { Subnet } from "./.gen/providers/aws/subnet"; +import { Vpc } from "./.gen/providers/aws/vpc"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const myVpc = new Vpc(this, "my_vpc", { + cidrBlock: "172.16.0.0/16", + tags: { + Name: "tf-example", + }, + }); + const mySubnet = new Subnet(this, "my_subnet", { + availabilityZone: "us-west-2a", + cidrBlock: "172.16.10.0/24", + tags: { + Name: "tf-example", + }, + vpcId: myVpc.id, + }); + const foo = new NetworkInterface(this, "foo", { + privateIps: ["172.16.10.100"], + subnetId: mySubnet.id, + tags: { + Name: "primary_network_interface", + }, + }); + const awsInstanceFoo = new Instance(this, "foo_3", { + ami: "ami-005e54dee72cc1d00", + creditSpecification: { + cpuCredits: "unlimited", + }, + instanceType: "t2.micro", + networkInterface: [ + { + deviceIndex: 0, + networkInterfaceId: foo.id, + }, + ], + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsInstanceFoo.overrideLogicalId("foo"); + } +} + +``` + +### CPU options example + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsAmi } from "./.gen/providers/aws/data-aws-ami"; +import { Instance } from "./.gen/providers/aws/instance"; +import { Subnet } from "./.gen/providers/aws/subnet"; +import { Vpc } from "./.gen/providers/aws/vpc"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Vpc(this, "example", { + cidrBlock: "172.16.0.0/16", + tags: { + Name: "tf-example", + }, + }); + const amznLinux2023Ami = new DataAwsAmi(this, "amzn-linux-2023-ami", { + filter: [ + { + name: "name", + values: ["al2023-ami-2023.*-x86_64"], + }, + ], + mostRecent: true, + owners: ["amazon"], + }); + const awsSubnetExample = new Subnet(this, "example_2", { + availabilityZone: "us-east-2a", + cidrBlock: "172.16.10.0/24", + tags: { + Name: "tf-example", + }, + vpcId: example.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsSubnetExample.overrideLogicalId("example"); + const awsInstanceExample = new Instance(this, "example_3", { + ami: Token.asString(amznLinux2023Ami.id), + cpuOptions: { + coreCount: 2, + threadsPerCore: 2, + }, + instanceType: "c6a.2xlarge", + subnetId: Token.asString(awsSubnetExample.id), + tags: { + Name: "tf-example", + }, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsInstanceExample.overrideLogicalId("example"); + } +} + +``` + +### Host resource group or Licence Manager registered AMI example + +A host resource group is a collection of Dedicated Hosts that you can manage as a single entity. As you launch instances, License Manager allocates the hosts and launches instances on them based on the settings that you configured. You can add existing Dedicated Hosts to a host resource group and take advantage of automated host management through License Manager. + +-> **NOTE:** A dedicated host is automatically associated with a License Manager host resource group if **Allocate hosts automatically** is enabled. Otherwise, use the `hostResourceGroupArn` argument to explicitly associate the instance with the host resource group. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Instance } from "./.gen/providers/aws/instance"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Instance(this, "this", { + ami: "ami-0dcc1e21636832c5d", + hostResourceGroupArn: + "arn:aws:resource-groups:us-west-2:012345678901:group/win-testhost", + instanceType: "m5.large", + tenancy: "host", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `ami` - (Optional) AMI to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template. +* `associatePublicIpAddress` - (Optional) Whether to associate a public IP address with an instance in a VPC. +* `availabilityZone` - (Optional) AZ to start the instance in. + +* `capacityReservationSpecification` - (Optional) Describes an instance's Capacity Reservation targeting option. See [Capacity Reservation Specification](#capacity-reservation-specification) below for more details. + +-> **NOTE:** Changing `cpuCoreCount` and/or `cpuThreadsPerCore` will cause the resource to be destroyed and re-created. + +* `cpuCoreCount` - (Optional, **Deprecated** use the `cpuOptions` argument instead) Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. +* `cpuOptions` - (Optional) The CPU options for the instance. See [CPU Options](#cpu-options) below for more details. +* `cpuThreadsPerCore` - (Optional - has no effect unless `cpuCoreCount` is also set, **Deprecated** use the `cpuOptions` argument instead) If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. +* `creditSpecification` - (Optional) Configuration block for customizing the credit specification of the instance. See [Credit Specification](#credit-specification) below for more details. Terraform will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type. +* `disableApiStop` - (Optional) If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection). +* `disableApiTermination` - (Optional) If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination). +* `ebsBlockDevice` - (Optional) One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects. +* `ebsOptimized` - (Optional) If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information. +* `enclaveOptions` - (Optional) Enable Nitro Enclaves on launched instances. See [Enclave Options](#enclave-options) below for more details. +* `ephemeralBlockDevice` - (Optional) One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details. When accessing this as an attribute reference, it is a set of objects. +* `getPasswordData` - (Optional) If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `passwordData` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. +* `hibernation` - (Optional) If true, the launched EC2 instance will support hibernation. +* `hostId` - (Optional) ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. +* `hostResourceGroupArn` - (Optional) ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`. +* `iamInstanceProfile` - (Optional) IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:passRole`. +* `instanceInitiatedShutdownBehavior` - (Optional) Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information. +* `instanceMarketOptions` - (Optional) Describes the market (purchasing) option for the instances. See [Market Options](#market-options) below for details on attributes. +* `instanceType` - (Optional) Instance type to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instanceType` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance. +* `ipv6AddressCount`- (Optional) Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. +* `ipv6Addresses` - (Optional) Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface +* `keyName` - (Optional) Key name of the Key Pair to use for the instance; which can be managed using [the `awsKeyPair` resource](key_pair.html). +* `launchTemplate` - (Optional) Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See [Launch Template Specification](#launch-template-specification) below for more details. +* `maintenanceOptions` - (Optional) Maintenance and recovery options for the instance. See [Maintenance Options](#maintenance-options) below for more details. +* `metadataOptions` - (Optional) Customize the metadata options of the instance. See [Metadata Options](#metadata-options) below for more details. +* `monitoring` - (Optional) If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0) +* `networkInterface` - (Optional) Customize network interfaces to be attached at instance boot time. See [Network Interfaces](#network-interfaces) below for more details. +* `placementGroup` - (Optional) Placement Group to start the instance in. +* `placementPartitionNumber` - (Optional) Number of the partition the instance is in. Valid only if [the `awsPlacementGroup` resource's](placement_group.html) `strategy` argument is set to `"partition"`. +* `privateDnsNameOptions` - (Optional) Options for the instance hostname. The default values are inherited from the subnet. See [Private DNS Name Options](#private-dns-name-options) below for more details. +* `privateIp` - (Optional) Private IP address to associate with the instance in a VPC. +* `rootBlockDevice` - (Optional) Configuration block to customize details about the root block device of the instance. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details. When accessing this as an attribute reference, it is a list containing one object. +* `secondaryPrivateIps` - (Optional) List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `networkInterface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. +* `securityGroups` - (Optional, EC2-Classic and default VPC only) List of security group names to associate with. + +-> **NOTE:** If you are creating Instances in a VPC, use `vpcSecurityGroupIds` instead. + +* `sourceDestCheck` - (Optional) Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. +* `subnetId` - (Optional) VPC Subnet ID to launch in. +* `tags` - (Optional) Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `tenancy` - (Optional) Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`. +* `userData` - (Optional) User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. +* `userDataBase64` - (Optional) Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. +* `userDataReplaceOnChange` - (Optional) When used in combination with `userData` or `userDataBase64` will trigger a destroy and recreate when set to `true`. Defaults to `false` if not set. +* `volumeTags` - (Optional) Map of tags to assign, at instance-creation time, to root and EBS volumes. + +~> **NOTE:** Do not use `volumeTags` if you plan to manage block device tags outside the `awsInstance` configuration, such as using `tags` in an [`awsEbsVolume`](/docs/providers/aws/r/ebs_volume.html) resource attached via [`awsVolumeAttachment`](/docs/providers/aws/r/volume_attachment.html). Doing so will result in resource cycling and inconsistent behavior. + +* `vpcSecurityGroupIds` - (Optional, VPC only) List of security group IDs to associate with. + +### Capacity Reservation Specification + +~> **NOTE:** You can specify only one argument at a time. If you specify both `capacityReservationPreference` and `capacityReservationTarget`, the request fails. Modifying `capacityReservationPreference` or `capacityReservationTarget` in this block requires the instance to be in `stopped` state. + +Capacity reservation specification can be applied/modified to the EC2 Instance at creation time or when the instance is `stopped`. + +The `capacityReservationSpecification` block supports the following: + +* `capacityReservationPreference` - (Optional) Indicates the instance's Capacity Reservation preferences. Can be `"open"` or `"none"`. (Default: `"open"`). +* `capacityReservationTarget` - (Optional) Information about the target Capacity Reservation. See [Capacity Reservation Target](#capacity-reservation-target) below for more details. + +For more information, see the documentation on [Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html). + +### Capacity Reservation Target + +~> **NOTE:** Modifying `capacityReservationId` in this block requires the instance to be in `stopped` state. + +Describes a target Capacity Reservation. + +This `capacityReservationTarget` block supports the following: + +* `capacityReservationId` - (Optional) ID of the Capacity Reservation in which to run the instance. +* `capacityReservationResourceGroupArn` - (Optional) ARN of the Capacity Reservation resource group in which to run the instance. + +### CPU Options + +-> **NOTE:** Changing any of `amdSevSnp`, `coreCount`, `threadsPerCore` will cause the resource to be destroyed and re-created. + +CPU options apply to the instance at launch time. + +The `cpuOptions` block supports the following: + +* `amdSevSnp` - (Optional) Indicates whether to enable the instance for AMD SEV-SNP. AMD SEV-SNP is supported with M6a, R6a, and C6a instance types only. Valid values are `enabled` and `disabled`. +* `coreCount` - (Optional) Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. +* `threadsPerCore` - (Optional - has no effect unless `coreCount` is also set) If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. + +For more information, see the documentation on [Optimizing CPU options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html). + +### Credit Specification + +The `creditSpecification` block supports the following: + +* `cpuCredits` - (Optional) Credit option for CPU usage. Valid values include `standard` or `unlimited`. T3 instances are launched as unlimited by default. T2 instances are launched as standard by default. + +### EBS, Ephemeral, and Root Block Devices + +Each of the `*BlockDevice` attributes control a portion of the EC2 Instance's "Block Device Mapping". For more information, see the [AWS Block Device Mapping documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html). + +The `rootBlockDevice` block supports the following: + +* `deleteOnTermination` - (Optional) Whether the volume should be destroyed on instance termination. Defaults to `true`. +* `encrypted` - (Optional) Whether to enable volume encryption. Defaults to `false`. Must be configured to perform drift detection. +* `iops` - (Optional) Amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). Only valid for volume_type of `io1`, `io2` or `gp3`. +* `kmsKeyId` - (Optional) Amazon Resource Name (ARN) of the KMS Key to use when encrypting the volume. Must be configured to perform drift detection. +* `tags` - (Optional) Map of tags to assign to the device. +* `throughput` - (Optional) Throughput to provision for a volume in mebibytes per second (MiB/s). This is only valid for `volumeType` of `gp3`. +* `volumeSize` - (Optional) Size of the volume in gibibytes (GiB). +* `volumeType` - (Optional) Type of volume. Valid values include `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1`, or `st1`. Defaults to `gp2`. + +Modifying the `encrypted` or `kmsKeyId` settings of the `rootBlockDevice` requires resource replacement. + +Each `ebsBlockDevice` block supports the following: + +* `deleteOnTermination` - (Optional) Whether the volume should be destroyed on instance termination. Defaults to `true`. +* `deviceName` - (Required) Name of the device to mount. +* `encrypted` - (Optional) Enables [EBS encryption](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) on the volume. Defaults to `false`. Cannot be used with `snapshotId`. Must be configured to perform drift detection. +* `iops` - (Optional) Amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). Only valid for volume_type of `io1`, `io2` or `gp3`. +* `kmsKeyId` - (Optional) Amazon Resource Name (ARN) of the KMS Key to use when encrypting the volume. Must be configured to perform drift detection. +* `snapshotId` - (Optional) Snapshot ID to mount. +* `tags` - (Optional) Map of tags to assign to the device. +* `throughput` - (Optional) Throughput to provision for a volume in mebibytes per second (MiB/s). This is only valid for `volumeType` of `gp3`. +* `volumeSize` - (Optional) Size of the volume in gibibytes (GiB). +* `volumeType` - (Optional) Type of volume. Valid values include `standard`, `gp2`, `gp3`, `io1`, `io2`, `sc1`, or `st1`. Defaults to `gp2`. + +~> **NOTE:** Currently, changes to the `ebsBlockDevice` configuration of _existing_ resources cannot be automatically detected by Terraform. To manage changes and attachments of an EBS block to an instance, use the `awsEbsVolume` and `awsVolumeAttachment` resources instead. If you use `ebsBlockDevice` on an `awsInstance`, Terraform will assume management over the full set of non-root EBS block devices for the instance, treating additional block devices as drift. For this reason, `ebsBlockDevice` cannot be mixed with external `awsEbsVolume` and `awsVolumeAttachment` resources for a given instance. + +Each `ephemeralBlockDevice` block supports the following: + +* `deviceName` - Name of the block device to mount on the instance. +* `noDevice` - (Optional) Suppresses the specified device included in the AMI's block device mapping. +* `virtualName` - (Optional) [Instance Store Device Name](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#InstanceStoreDeviceNames) (e.g., `ephemeral0`). + +Each AWS Instance type has a different set of Instance Store block devices available for attachment. AWS [publishes a list](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#StorageOnInstanceTypes) of which ephemeral devices are available on each type. The devices are always identified by the `virtualName` in the format `ephemeral{0N}`. + +### Enclave Options + +-> **NOTE:** Changing `enabled` will cause the resource to be destroyed and re-created. + +Enclave options apply to the instance at boot time. + +The `enclaveOptions` block supports the following: + +* `enabled` - (Optional) Whether Nitro Enclaves will be enabled on the instance. Defaults to `false`. + +For more information, see the documentation on [Nitro Enclaves](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html). + +### Maintenance Options + +The `maintenanceOptions` block supports the following: + +* `autoRecovery` - (Optional) Automatic recovery behavior of the Instance. Can be `"default"` or `"disabled"`. See [Recover your instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html) for more details. + +### Market Options + +The `instanceMarketOptions` block supports the following: + +* `marketType` - (Optional) Type of market for the instance. Valid value is `spot`. Defaults to `spot`. +* `spotOptions` - (Optional) Block to configure the options for Spot Instances. See [Spot Options](#spot-options) below for details on attributes. + +### Metadata Options + +Metadata options can be applied/modified to the EC2 Instance at any time. + +The `metadataOptions` block supports the following: + +* `httpEndpoint` - (Optional) Whether the metadata service is available. Valid values include `enabled` or `disabled`. Defaults to `enabled`. +* `httpPutResponseHopLimit` - (Optional) Desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel. Valid values are integer from `1` to `64`. Defaults to `1`. +* `httpTokens` - (Optional) Whether or not the metadata service requires session tokens, also referred to as _Instance Metadata Service Version 2 (IMDSv2)_. Valid values include `optional` or `required`. Defaults to `optional`. +* `instanceMetadataTags` - (Optional) Enables or disables access to instance tags from the instance metadata service. Valid values include `enabled` or `disabled`. Defaults to `disabled`. + +For more information, see the documentation on the [Instance Metadata Service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). + +### Network Interfaces + +Each of the `networkInterface` blocks attach a network interface to an EC2 Instance during boot time. However, because the network interface is attached at boot-time, replacing/modifying the network interface **WILL** trigger a recreation of the EC2 Instance. If you should need at any point to detach/modify/re-attach a network interface to the instance, use the `awsNetworkInterface` or `awsNetworkInterfaceAttachment` resources instead. + +The `networkInterface` configuration block _does_, however, allow users to supply their own network interface to be used as the default network interface on an EC2 Instance, attached at `eth0`. + +Each `networkInterface` block supports the following: + +* `deleteOnTermination` - (Optional) Whether or not to delete the network interface on instance termination. Defaults to `false`. Currently, the only valid value is `false`, as this is only supported when creating new network interfaces when launching an instance. +* `deviceIndex` - (Required) Integer index of the network interface attachment. Limited by instance type. +* `networkCardIndex` - (Optional) Integer index of the network card. Limited by instance type. The default index is `0`. +* `networkInterfaceId` - (Required) ID of the network interface to attach. + +### Private DNS Name Options + +The `privateDnsNameOptions` block supports the following: + +* `enableResourceNameDnsAaaaRecord` - Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. +* `enableResourceNameDnsARecord` - Indicates whether to respond to DNS queries for instance hostnames with DNS A records. +* `hostnameType` - Type of hostname for Amazon EC2 instances. For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 native subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: `ipName` and `resourceName`. + +### Spot Options + +The `spotOptions` block supports the following: + +* `instanceInterruptionBehavior` - (Optional) The behavior when a Spot Instance is interrupted. Valid values include `hibernate`, `stop`, `terminate` . The default is `terminate`. +* `maxPrice` - (Optional) The maximum hourly price that you're willing to pay for a Spot Instance. +* `spotInstanceType` - (Optional) The Spot Instance request type. Valid values include `oneTime`, `persistent`. Persistent Spot Instance requests are only supported when the instance interruption behavior is either hibernate or stop. The default is `oneTime`. +* `validUntil` - (Optional) The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). Supported only for persistent requests. + +### Launch Template Specification + +-> **Note:** Launch Template parameters will be used only once during instance creation. If you want to update existing instance you need to change parameters +directly. Updating Launch Template specification will force a new instance. + +Any other instance parameters that you specify will override the same parameters in the launch template. + +The `launchTemplate` block supports the following: + +* `id` - ID of the launch template. Conflicts with `name`. +* `name` - Name of the launch template. Conflicts with `id`. +* `version` - Template version. Can be a specific version number, `$latest` or `$default`. The default value is `$default`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the instance. +* `capacityReservationSpecification` - Capacity reservation specification of the instance. +* `instanceState` - State of the instance. One of: `pending`, `running`, `shuttingDown`, `terminated`, `stopping`, `stopped`. See [Instance Lifecycle](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) for more information. +* `outpostArn` - ARN of the Outpost the instance is assigned to. +* `passwordData` - Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if `getPasswordData` is true. Note that this encrypted value will be stored in the state file, as with all exported attributes. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. +* `primaryNetworkInterfaceId` - ID of the instance's primary network interface. +* `privateDns` - Private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC. +* `publicDns` - Public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC. +* `publicIp` - Public IP address assigned to the instance, if applicable. **NOTE**: If you are using an [`awsEip`](/docs/providers/aws/r/eip.html) with your instance, you should refer to the EIP's address directly and not use `publicIp` as this field will change after the EIP is attached. +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +For `ebsBlockDevice`, in addition to the arguments above, the following attribute is exported: + +* `volumeId` - ID of the volume. For example, the ID can be accessed like this, `awsInstanceWebEbsBlockDevice2VolumeId`. + +For `rootBlockDevice`, in addition to the arguments above, the following attributes are exported: + +* `volumeId` - ID of the volume. For example, the ID can be accessed like this, `awsInstanceWebRootBlockDevice0VolumeId`. +* `deviceName` - Device name, e.g., `/dev/sdh` or `xvdh`. + +For `instanceMarketOptions`, in addition to the arguments above, the following attributes are exported: + +* `instanceLifecycle` - Indicates whether this is a Spot Instance or a Scheduled Instance. +* `spotInstanceRequestId` - If the request is a Spot Instance request, the ID of the request. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `10M`) +* `update` - (Default `10M`) +* `delete` - (Default `20M`) + +## Import + +Instances can be imported using the `id`, e.g., + +``` +$ terraform import aws_instance.web i-12345678 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_alias.html.markdown b/website/docs/cdktf/typescript/r/lambda_alias.html.markdown new file mode 100644 index 00000000000..87698ff3655 --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_alias.html.markdown @@ -0,0 +1,79 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_alias" +description: |- + Creates a Lambda function alias. +--- + + + +# Resource: aws_lambda_alias + +Creates a Lambda function alias. Creates an alias that points to the specified Lambda function version. + +For information about Lambda and how to use it, see [What is AWS Lambda?][1] +For information about function aliases, see [CreateAlias][2] and [AliasRoutingConfiguration][3] in the API docs. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaAlias } from "./.gen/providers/aws/lambda-alias"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaAlias(this, "test_lambda_alias", { + description: "a sample description", + functionName: lambdaFunctionTest.arn, + functionVersion: "1", + name: "my_alias", + routingConfig: { + additionalVersionWeights: { + 2: 0.5, + }, + }, + }); + } +} + +``` + +## Argument Reference + +* `name` - (Required) Name for the alias you are creating. Pattern: `(?!^[09]+$)([aZAZ09_]+)` +* `description` - (Optional) Description of the alias. +* `functionName` - (Required) Lambda Function name or ARN. +* `functionVersion` - (Required) Lambda function version for which you are creating the alias. Pattern: `(\$latest|[09]+)`. +* `routingConfig` - (Optional) The Lambda alias' route configuration settings. Fields documented below + +For **routing_config** the following attributes are supported: + +* `additionalVersionWeights` - (Optional) A map that defines the proportion of events that should be sent to different versions of a lambda function. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) identifying your Lambda function alias. +* `invokeArn` - The ARN to be used for invoking Lambda Function from API Gateway - to be used in [`awsApiGatewayIntegration`](/docs/providers/aws/r/api_gateway_integration.html)'s `uri` + +[1]: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html +[2]: http://docs.aws.amazon.com/lambda/latest/dg/API_CreateAlias.html +[3]: https://docs.aws.amazon.com/lambda/latest/dg/API_AliasRoutingConfiguration.html + +## Import + +Lambda Function Aliases can be imported using the `functionName/alias`, e.g., + +``` +$ terraform import aws_lambda_alias.test_lambda_alias my_test_lambda_function/my_alias +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_code_signing_config.html.markdown b/website/docs/cdktf/typescript/r/lambda_code_signing_config.html.markdown new file mode 100644 index 00000000000..cf4a30afa61 --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_code_signing_config.html.markdown @@ -0,0 +1,77 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_code_signing_config" +description: |- + Provides a Lambda Code Signing Config resource. +--- + + + +# Resource: aws_lambda_code_signing_config + +Provides a Lambda Code Signing Config resource. A code signing configuration defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if deployment validation checks fail). + +For information about Lambda code signing configurations and how to use them, see [configuring code signing for Lambda functions][1] + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaCodeSigningConfig } from "./.gen/providers/aws/lambda-code-signing-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaCodeSigningConfig(this, "new_csc", { + allowedPublishers: { + signingProfileVersionArns: [example1.arn, example2.arn], + }, + description: "My awesome code signing config.", + policies: { + untrustedArtifactOnDeployment: "Warn", + }, + }); + } +} + +``` + +## Argument Reference + +* `allowedPublishers` (Required) A configuration block of allowed publishers as signing profiles for this code signing configuration. Detailed below. +* `policies` (Optional) A configuration block of code signing policies that define the actions to take if the validation checks fail. Detailed below. +* `description` - (Optional) Descriptive name for this code signing configuration. + +The `allowedPublishers` block supports the following argument: + +* `signingProfileVersionArns` - (Required) The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package. + +The `policies` block supports the following argument: + +* `untrustedArtifactOnDeployment` - (Required) Code signing configuration policy for deployment validation failure. If you set the policy to Enforce, Lambda blocks the deployment request if code-signing validation checks fail. If you set the policy to Warn, Lambda allows the deployment and creates a CloudWatch log. Valid values: `warn`, `enforce`. Default value: `warn`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the code signing configuration. +* `configId` - Unique identifier for the code signing configuration. +* `lastModified` - The date and time that the code signing configuration was last modified. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html + +## Import + +Code Signing Configs can be imported using their ARN, e.g., + +``` +$ terraform import aws_lambda_code_signing_config.imported_csc arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0f6c334abcdea4d8b +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_event_source_mapping.html.markdown b/website/docs/cdktf/typescript/r/lambda_event_source_mapping.html.markdown new file mode 100644 index 00000000000..e196414bb67 --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_event_source_mapping.html.markdown @@ -0,0 +1,360 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_event_source_mapping" +description: |- + Provides a Lambda event source mapping. This allows Lambda functions to get events from Kinesis, DynamoDB, SQS, Amazon MQ and Managed Streaming for Apache Kafka (MSK). +--- + + + +# Resource: aws_lambda_event_source_mapping + +Provides a Lambda event source mapping. This allows Lambda functions to get events from Kinesis, DynamoDB, SQS, Amazon MQ and Managed Streaming for Apache Kafka (MSK). + +For information about Lambda and how to use it, see [What is AWS Lambda?][1]. +For information about event source mappings, see [CreateEventSourceMapping][2] in the API docs. + +## Example Usage + +### DynamoDB + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaEventSourceMapping } from "./.gen/providers/aws/lambda-event-source-mapping"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaEventSourceMapping(this, "example", { + eventSourceArn: Token.asString(awsDynamodbTableExample.streamArn), + functionName: Token.asString(awsLambdaFunctionExample.arn), + startingPosition: "LATEST", + }); + } +} + +``` + +### Kinesis + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaEventSourceMapping } from "./.gen/providers/aws/lambda-event-source-mapping"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaEventSourceMapping(this, "example", { + eventSourceArn: Token.asString(awsKinesisStreamExample.arn), + functionName: Token.asString(awsLambdaFunctionExample.arn), + startingPosition: "LATEST", + }); + } +} + +``` + +### Managed Streaming for Apache Kafka (MSK) + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaEventSourceMapping } from "./.gen/providers/aws/lambda-event-source-mapping"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaEventSourceMapping(this, "example", { + eventSourceArn: Token.asString(awsMskClusterExample.arn), + functionName: Token.asString(awsLambdaFunctionExample.arn), + startingPosition: "TRIM_HORIZON", + topics: ["Example"], + }); + } +} + +``` + +### Self Managed Apache Kafka + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaEventSourceMapping } from "./.gen/providers/aws/lambda-event-source-mapping"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaEventSourceMapping(this, "example", { + functionName: Token.asString(awsLambdaFunctionExample.arn), + selfManagedEventSource: { + endpoints: { + KAFKA_BOOTSTRAP_SERVERS: + "kafka1.example.com:9092,kafka2.example.com:9092", + }, + }, + sourceAccessConfiguration: [ + { + type: "VPC_SUBNET", + uri: "subnet:subnet-example1", + }, + { + type: "VPC_SUBNET", + uri: "subnet:subnet-example2", + }, + { + type: "VPC_SECURITY_GROUP", + uri: "security_group:sg-example", + }, + ], + startingPosition: "TRIM_HORIZON", + topics: ["Example"], + }); + } +} + +``` + +### SQS + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaEventSourceMapping } from "./.gen/providers/aws/lambda-event-source-mapping"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaEventSourceMapping(this, "example", { + eventSourceArn: sqsQueueTest.arn, + functionName: Token.asString(awsLambdaFunctionExample.arn), + }); + } +} + +``` + +### SQS with event filter + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaEventSourceMapping } from "./.gen/providers/aws/lambda-event-source-mapping"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaEventSourceMapping(this, "example", { + eventSourceArn: sqsQueueTest.arn, + filterCriteria: { + filter: [ + { + pattern: Token.asString( + Fn.jsonencode({ + body: { + Location: ["New York"], + Temperature: [ + { + numeric: [">", 0, "<=", 100], + }, + ], + }, + }) + ), + }, + ], + }, + functionName: Token.asString(awsLambdaFunctionExample.arn), + }); + } +} + +``` + +### Amazon MQ (ActiveMQ) + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaEventSourceMapping } from "./.gen/providers/aws/lambda-event-source-mapping"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaEventSourceMapping(this, "example", { + batchSize: 10, + enabled: true, + eventSourceArn: Token.asString(awsMqBrokerExample.arn), + functionName: Token.asString(awsLambdaFunctionExample.arn), + queues: ["example"], + sourceAccessConfiguration: [ + { + type: "BASIC_AUTH", + uri: Token.asString(awsSecretsmanagerSecretVersionExample.arn), + }, + ], + }); + } +} + +``` + +### Amazon MQ (RabbitMQ) + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaEventSourceMapping } from "./.gen/providers/aws/lambda-event-source-mapping"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaEventSourceMapping(this, "example", { + batchSize: 1, + enabled: true, + eventSourceArn: Token.asString(awsMqBrokerExample.arn), + functionName: Token.asString(awsLambdaFunctionExample.arn), + queues: ["example"], + sourceAccessConfiguration: [ + { + type: "VIRTUAL_HOST", + uri: "/example", + }, + { + type: "BASIC_AUTH", + uri: Token.asString(awsSecretsmanagerSecretVersionExample.arn), + }, + ], + }); + } +} + +``` + +## Argument Reference + +* `amazonManagedKafkaEventSourceConfig` - (Optional) Additional configuration block for Amazon Managed Kafka sources. Incompatible with "self_managed_event_source" and "self_managed_kafka_event_source_config". Detailed below. +* `batchSize` - (Optional) The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to `100` for DynamoDB, Kinesis, MQ and MSK, `10` for SQS. +* `bisectBatchOnFunctionError`: - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`. +* `destinationConfig`: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below. +* `documentDbEventSourceConfig`: - (Optional) Configuration settings for a DocumentDB event source. Detailed below. +* `enabled` - (Optional) Determines if the mapping will be enabled on creation. Defaults to `true`. +* `eventSourceArn` - (Optional) The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker, MSK cluster or DocumentDB change stream. It is incompatible with a Self Managed Kafka source. +* `filterCriteria` - (Optional) The criteria to use for [event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html) Kinesis stream, DynamoDB stream, SQS queue event sources. Detailed below. +* `functionName` - (Required) The name or the ARN of the Lambda function that will be subscribing to events. +* `functionResponseTypes` - (Optional) A list of current response type enums applied to the event source mapping for [AWS Lambda checkpointing](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-batchfailurereporting). Only available for SQS and stream sources (DynamoDB and Kinesis). Valid values: `reportBatchItemFailures`. +* `maximumBatchingWindowInSeconds` - (Optional) The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300). Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either `maximumBatchingWindowInSeconds` expires or `batchSize` has been met. For streaming event sources, defaults to as soon as records are available in the stream. If the batch it reads from the stream/queue only has one record in it, Lambda only sends one record to the function. Only available for stream sources (DynamoDB and Kinesis) and SQS standard queues. +* `maximumRecordAgeInSeconds`: - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive). +* `maximumRetryAttempts`: - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000. +* `parallelizationFactor`: - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10. +* `queues` - (Optional) The name of the Amazon MQ broker destination queue to consume. Only available for MQ sources. A single queue name must be specified. +* `scalingConfig` - (Optional) Scaling configuration of the event source. Only available for SQS queues. Detailed below. +* `selfManagedEventSource`: - (Optional) For Self Managed Kafka sources, the location of the self managed cluster. If set, configuration must also include `sourceAccessConfiguration`. Detailed below. +* `selfManagedKafkaEventSourceConfig` - (Optional) Additional configuration block for Self Managed Kafka sources. Incompatible with "event_source_arn" and "amazon_managed_kafka_event_source_config". Detailed below. +* `sourceAccessConfiguration`: (Optional) For Self Managed Kafka sources, the access configuration for the source. If set, configuration must also include `selfManagedEventSource`. Detailed below. +* `startingPosition` - (Optional) The position in the stream where AWS Lambda should start reading. Must be one of `atTimestamp` (Kinesis only), `latest` or `trimHorizon` if getting events from Kinesis, DynamoDB, MSK or Self Managed Apache Kafka. Must not be provided if getting events from SQS. More information about these positions can be found in the [AWS DynamoDB Streams API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) and [AWS Kinesis API Reference](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType). +* `startingPositionTimestamp` - (Optional) A timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of the data record which to start reading when using `startingPosition` set to `atTimestamp`. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen. +* `topics` - (Optional) The name of the Kafka topics. Only available for MSK sources. A single topic name must be specified. +* `tumblingWindowInSeconds` - (Optional) The duration in seconds of a processing window for [AWS Lambda streaming analytics](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-windows). The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis). + +### amazon_managed_kafka_event_source_config Configuration Block + +* `consumerGroupId` - (Optional) A Kafka consumer group ID between 1 and 200 characters for use when creating this event source mapping. If one is not specified, this value will be automatically generated. See [AmazonManagedKafkaEventSourceConfig Syntax](https://docs.aws.amazon.com/lambda/latest/dg/API_AmazonManagedKafkaEventSourceConfig.html). + +### destination_config Configuration Block + +* `onFailure` - (Optional) The destination configuration for failed invocations. Detailed below. + +#### destination_config on_failure Configuration Block + +* `destinationArn` - (Required) The Amazon Resource Name (ARN) of the destination resource. + +### document_db_event_source_config Configuration Block + +* `collectionName` - (Optional) The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections. +* `databaseName` - (Required) The name of the database to consume within the DocumentDB cluster. +* `fullDocument` - (Optional) Determines what DocumentDB sends to your event stream during document update operations. If set to `updateLookup`, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes. Valid values: `updateLookup`, `default`. + +### filter_criteria Configuration Block + +* `filter` - (Optional) A set of up to 5 filter. If an event satisfies at least one, Lambda sends the event to the function or adds it to the next batch. Detailed below. + +#### filter_criteria filter Configuration Block + +* `pattern` - (Optional) A filter pattern up to 4096 characters. See [Filter Rule Syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax). + +### scaling_config Configuration Block + +* `maximumConcurrency` - (Optional) Limits the number of concurrent instances that the Amazon SQS event source can invoke. Must be between `2` and `1000`. See [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + +### self_managed_event_source Configuration Block + +* `endpoints` - (Required) A map of endpoints for the self managed source. For Kafka self-managed sources, the key should be `kafkaBootstrapServers` and the value should be a string with a comma separated list of broker endpoints. + +### self_managed_kafka_event_source_config Configuration Block + +* `consumerGroupId` - (Optional) A Kafka consumer group ID between 1 and 200 characters for use when creating this event source mapping. If one is not specified, this value will be automatically generated. See [SelfManagedKafkaEventSourceConfig Syntax](https://docs.aws.amazon.com/lambda/latest/dg/API_SelfManagedKafkaEventSourceConfig.html). + +### source_access_configuration Configuration Block + +* `type` - (Required) The type of this configuration. For Self Managed Kafka you will need to supply blocks for type `vpcSubnet` and `vpcSecurityGroup`. +* `uri` - (Required) The URI for this configuration. For type `vpcSubnet` the value should be `subnet:subnetId` where `subnetId` is the value you would find in an aws_subnet resource's id attribute. For type `vpcSecurityGroup` the value should be `securityGroup:securityGroupId` where `securityGroupId` is the value you would find in an aws_security_group resource's id attribute. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `functionArn` - The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from `functionName` above.) +* `lastModified` - The date this resource was last modified. +* `lastProcessingResult` - The result of the last AWS Lambda invocation of your Lambda function. +* `state` - The state of the event source mapping. +* `stateTransitionReason` - The reason the event source mapping is in its current state. +* `uuid` - The UUID of the created event source mapping. + +[1]: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html +[2]: http://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html + +## Import + +Lambda event source mappings can be imported using the `uuid` (event source mapping identifier), e.g., + +``` +$ terraform import aws_lambda_event_source_mapping.event_source_mapping 12345kxodurf3443 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_function.html.markdown b/website/docs/cdktf/typescript/r/lambda_function.html.markdown new file mode 100644 index 00000000000..8b792ff6999 --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_function.html.markdown @@ -0,0 +1,461 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function" +description: |- + Provides a Lambda Function resource. Lambda allows you to trigger execution of code in response to events in AWS, enabling serverless backend solutions. The Lambda Function itself includes source code and runtime configuration. +--- + + + +# Resource: aws_lambda_function + +Provides a Lambda Function resource. Lambda allows you to trigger execution of code in response to events in AWS, enabling serverless backend solutions. The Lambda Function itself includes source code and runtime configuration. + +For information about Lambda and how to use it, see [What is AWS Lambda?][1] + +For a detailed example of setting up Lambda and API Gateway, see [Serverless Applications with AWS Lambda and API Gateway.][11] + +~> **NOTE:** Due to [AWS Lambda improved VPC networking changes that began deploying in September 2019](https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/), EC2 subnets and security groups associated with Lambda Functions can take up to 45 minutes to successfully delete. Terraform AWS Provider version 2.31.0 and later automatically handles this increased timeout, however prior versions require setting the customizable deletion timeouts of those Terraform resources to 45 minutes (`delete = "45m"`). AWS and HashiCorp are working together to reduce the amount of time required for resource deletion and updates can be tracked in this [GitHub issue](https://github.com/hashicorp/terraform-provider-aws/issues/10329). + +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`awsLambdaFunction`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + +-> To give an external source (like an EventBridge Rule, SNS, or S3) permission to access the Lambda function, use the [`awsLambdaPermission`](lambda_permission.html) resource. See [Lambda Permission Model][4] for more details. On the other hand, the `role` argument of this resource is the function's execution role for identity and access to AWS services and resources. + +## Example Usage + +### Basic Example + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataArchiveFile } from "./.gen/providers/archive/data-archive-file"; +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { LambdaFunction } from "./.gen/providers/aws/lambda-function"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*The following providers are missing schema information and might need manual adjustments to synthesize correctly: archive. + For a more precise conversion please use the --provider flag in convert.*/ + const lambda = new DataArchiveFile(this, "lambda", { + output_path: "lambda_function_payload.zip", + source_file: "lambda.js", + type: "zip", + }); + const assumeRole = new DataAwsIamPolicyDocument(this, "assume_role", { + statement: [ + { + actions: ["sts:AssumeRole"], + effect: "Allow", + principals: [ + { + identifiers: ["lambda.amazonaws.com"], + type: "Service", + }, + ], + }, + ], + }); + const iamForLambda = new IamRole(this, "iam_for_lambda", { + assumeRolePolicy: Token.asString(assumeRole.json), + name: "iam_for_lambda", + }); + new LambdaFunction(this, "test_lambda", { + environment: { + variables: { + foo: "bar", + }, + }, + filename: "lambda_function_payload.zip", + functionName: "lambda_function_name", + handler: "index.test", + role: iamForLambda.arn, + runtime: "nodejs16.x", + sourceCodeHash: Token.asString(lambda.outputBase64Sha256), + }); + } +} + +``` + +### Lambda Layers + +~> **NOTE:** The `awsLambdaLayerVersion` attribute values for `arn` and `layerArn` were swapped in version 2.0.0 of the Terraform AWS Provider. For version 1.x, use `layerArn` references. For version 2.x, use `arn` references. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaFunction } from "./.gen/providers/aws/lambda-function"; +import { LambdaLayerVersion } from "./.gen/providers/aws/lambda-layer-version"; +interface MyConfig { + layerName: any; + functionName: any; + role: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + const example = new LambdaLayerVersion(this, "example", { + layerName: config.layerName, + }); + const awsLambdaFunctionExample = new LambdaFunction(this, "example_1", { + layers: [example.arn], + functionName: config.functionName, + role: config.role, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsLambdaFunctionExample.overrideLogicalId("example"); + } +} + +``` + +### Lambda Ephemeral Storage + +Lambda Function Ephemeral Storage(`/tmp`) allows you to configure the storage upto `10` GB. The default value set to `512` MB. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { LambdaFunction } from "./.gen/providers/aws/lambda-function"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const assumeRole = new DataAwsIamPolicyDocument(this, "assume_role", { + statement: [ + { + actions: ["sts:AssumeRole"], + effect: "Allow", + principals: [ + { + identifiers: ["lambda.amazonaws.com"], + type: "Service", + }, + ], + }, + ], + }); + const iamForLambda = new IamRole(this, "iam_for_lambda", { + assumeRolePolicy: Token.asString(assumeRole.json), + name: "iam_for_lambda", + }); + new LambdaFunction(this, "test_lambda", { + ephemeralStorage: { + size: 10240, + }, + filename: "lambda_function_payload.zip", + functionName: "lambda_function_name", + handler: "index.test", + role: iamForLambda.arn, + runtime: "nodejs14.x", + }); + } +} + +``` + +### Lambda File Systems + +Lambda File Systems allow you to connect an Amazon Elastic File System (EFS) file system to a Lambda function to share data across function invocations, access existing data including large files, and save function state. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { EfsAccessPoint } from "./.gen/providers/aws/efs-access-point"; +import { EfsFileSystem } from "./.gen/providers/aws/efs-file-system"; +import { EfsMountTarget } from "./.gen/providers/aws/efs-mount-target"; +import { LambdaFunction } from "./.gen/providers/aws/lambda-function"; +interface MyConfig { + functionName: any; + role: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + const efsForLambda = new EfsFileSystem(this, "efs_for_lambda", { + tags: { + Name: "efs_for_lambda", + }, + }); + const alpha = new EfsMountTarget(this, "alpha", { + fileSystemId: efsForLambda.id, + securityGroups: [sgForLambda.id], + subnetId: subnetForLambda.id, + }); + const accessPointForLambda = new EfsAccessPoint( + this, + "access_point_for_lambda", + { + fileSystemId: efsForLambda.id, + posixUser: { + gid: 1000, + uid: 1000, + }, + rootDirectory: { + creationInfo: { + ownerGid: 1000, + ownerUid: 1000, + permissions: "777", + }, + path: "/lambda", + }, + } + ); + new LambdaFunction(this, "example", { + dependsOn: [alpha], + fileSystemConfig: { + arn: accessPointForLambda.arn, + localMountPath: "/mnt/efs", + }, + vpcConfig: { + securityGroupIds: [sgForLambda.id], + subnetIds: [subnetForLambda.id], + }, + functionName: config.functionName, + role: config.role, + }); + } +} + +``` + +### Lambda retries + +Lambda Functions allow you to configure error handling for asynchronous invocation. The settings that it supports are `Maximum age of event` and `Retry attempts` as stated in [Lambda documentation for Configuring error handling for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-errors). To configure these settings, refer to the [aws_lambda_function_event_invoke_config resource](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function_event_invoke_config). + +## CloudWatch Logging and Permissions + +For more information about CloudWatch Logs for Lambda, see the [Lambda User Guide](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-logs.html). + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformVariable, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { CloudwatchLogGroup } from "./.gen/providers/aws/cloudwatch-log-group"; +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { IamPolicy } from "./.gen/providers/aws/iam-policy"; +import { IamRolePolicyAttachment } from "./.gen/providers/aws/iam-role-policy-attachment"; +import { LambdaFunction } from "./.gen/providers/aws/lambda-function"; +interface MyConfig { + role: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + You can read more about this at https://cdk.tf/variables*/ + const lambdaFunctionName = new TerraformVariable( + this, + "lambda_function_name", + { + default: "lambda_function_name", + } + ); + const example = new CloudwatchLogGroup(this, "example", { + name: "/aws/lambda/${" + lambdaFunctionName.value + "}", + retentionInDays: 14, + }); + const lambdaLogging = new DataAwsIamPolicyDocument(this, "lambda_logging", { + statement: [ + { + actions: [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + ], + effect: "Allow", + resources: ["arn:aws:logs:*:*:*"], + }, + ], + }); + const awsIamPolicyLambdaLogging = new IamPolicy(this, "lambda_logging_3", { + description: "IAM policy for logging from a lambda", + name: "lambda_logging", + path: "/", + policy: Token.asString(lambdaLogging.json), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsIamPolicyLambdaLogging.overrideLogicalId("lambda_logging"); + const lambdaLogs = new IamRolePolicyAttachment(this, "lambda_logs", { + policyArn: Token.asString(awsIamPolicyLambdaLogging.arn), + role: iamForLambda.name, + }); + new LambdaFunction(this, "test_lambda", { + dependsOn: [lambdaLogs, example], + functionName: lambdaFunctionName.stringValue, + role: config.role, + }); + } +} + +``` + +## Specifying the Deployment Package + +AWS Lambda expects source code to be provided as a deployment package whose structure varies depending on which `runtime` is in use. See [Runtimes][6] for the valid values of `runtime`. The expected structure of the deployment package can be found in [the AWS Lambda documentation for each runtime][8]. + +Once you have created your deployment package you can specify it either directly as a local file (using the `filename` argument) or indirectly via Amazon S3 (using the `s3Bucket`, `s3Key` and `s3ObjectVersion` arguments). When providing the deployment package via S3 it may be useful to use [the `awsS3Object` resource](s3_object.html) to upload it. + +For larger deployment packages it is recommended by Amazon to upload via S3, since the S3 API has better support for uploading large files efficiently. + +## Argument Reference + +The following arguments are required: + +* `functionName` - (Required) Unique name for your Lambda Function. +* `role` - (Required) Amazon Resource Name (ARN) of the function's execution role. The role provides the function's identity and access to AWS services and resources. + +The following arguments are optional: + +* `architectures` - (Optional) Instruction set architecture for your Lambda function. Valid values are `["x8664"]` and `["arm64"]`. Default is `["x8664"]`. Removing this attribute, function's architecture stay the same. +* `codeSigningConfigArn` - (Optional) To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function. +* `deadLetterConfig` - (Optional) Configuration block. Detailed below. +* `description` - (Optional) Description of what your Lambda Function does. +* `environment` - (Optional) Configuration block. Detailed below. +* `ephemeralStorage` - (Optional) The amount of Ephemeral storage(`/tmp`) to allocate for the Lambda Function in MB. This parameter is used to expand the total amount of Ephemeral storage available, beyond the default amount of `512`MB. Detailed below. +* `fileSystemConfig` - (Optional) Configuration block. Detailed below. +* `filename` - (Optional) Path to the function's deployment package within the local filesystem. Exactly one of `filename`, `imageUri`, or `s3Bucket` must be specified. +* `handler` - (Optional) Function [entrypoint][3] in your code. +* `imageConfig` - (Optional) Configuration block. Detailed below. +* `imageUri` - (Optional) ECR image URI containing the function's deployment package. Exactly one of `filename`, `imageUri`, or `s3Bucket` must be specified. +* `kmsKeyArn` - (Optional) Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and Terraform will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration. +* `layers` - (Optional) List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See [Lambda Layers][10] +* `memorySize` - (Optional) Amount of memory in MB your Lambda Function can use at runtime. Defaults to `128`. See [Limits][5] +* `packageType` - (Optional) Lambda deployment package type. Valid values are `zip` and `image`. Defaults to `zip`. +* `publish` - (Optional) Whether to publish creation/change as new Lambda Function Version. Defaults to `false`. +* `reservedConcurrentExecutions` - (Optional) Amount of reserved concurrent executions for this lambda function. A value of `0` disables lambda from being triggered and `1` removes any concurrency limitations. Defaults to Unreserved Concurrency Limits `1`. See [Managing Concurrency][9] +* `replaceSecurityGroupsOnDestroy` - (Optional, **Deprecated**) **AWS no longer supports this operation. This attribute now has no effect and will be removed in a future major version.** Whether to replace the security groups on associated lambda network interfaces upon destruction. Removing these security groups from orphaned network interfaces can speed up security group deletion times by avoiding a dependency on AWS's internal cleanup operations. By default, the ENI security groups will be replaced with the `default` security group in the function's VPC. Set the `replacementSecurityGroupIds` attribute to use a custom list of security groups for replacement. +* `replacementSecurityGroupIds` - (Optional, **Deprecated**) List of security group IDs to assign to orphaned Lambda function network interfaces upon destruction. `replaceSecurityGroupsOnDestroy` must be set to `true` to use this attribute. +* `runtime` - (Optional) Identifier of the function's runtime. See [Runtimes][6] for valid values. +* `s3Bucket` - (Optional) S3 bucket location containing the function's deployment package. This bucket must reside in the same AWS region where you are creating the Lambda function. Exactly one of `filename`, `imageUri`, or `s3Bucket` must be specified. When `s3Bucket` is set, `s3Key` is required. +* `s3Key` - (Optional) S3 key of an object containing the function's deployment package. When `s3Bucket` is set, `s3Key` is required. +* `s3ObjectVersion` - (Optional) Object version containing the function's deployment package. Conflicts with `filename` and `imageUri`. +* `skipDestroy` - (Optional) Set to true if you do not wish the function to be deleted at destroy time, and instead just remove the function from the Terraform state. +* `sourceCodeHash` - (Optional) Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either `filename` or `s3Key`. The usual way to set this is `filebase64Sha256("fileZip")` (Terraform 0.11.12 and later) or `base64Sha256(file("fileZip"))` (Terraform 0.11.11 and earlier), where "file.zip" is the local filename of the lambda function source archive. +* `snapStart` - (Optional) Snap start settings block. Detailed below. +* `tags` - (Optional) Map of tags to assign to the object. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `timeout` - (Optional) Amount of time your Lambda Function has to run in seconds. Defaults to `3`. See [Limits][5]. +* `tracingConfig` - (Optional) Configuration block. Detailed below. +* `vpcConfig` - (Optional) Configuration block. Detailed below. + +### dead_letter_config + +Dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq). + +* `targetArn` - (Required) ARN of an SNS topic or SQS queue to notify when an invocation fails. If this option is used, the function's IAM role must be granted suitable access to write to the target object, which means allowing either the `sns:publish` or `sqs:sendMessage` action on this ARN, depending on which service is targeted. + +### environment + +* `variables` - (Optional) Map of environment variables that are accessible from the function code during execution. If provided at least one key must be present. + +### ephemeral_storage + +* `size` - (Required) The size of the Lambda function Ephemeral storage(`/tmp`) represented in MB. The minimum supported `ephemeralStorage` value defaults to `512`MB and the maximum supported value is `10240`MB. + +### file_system_config + +Connection settings for an EFS file system. Before creating or updating Lambda functions with `fileSystemConfig`, EFS mount targets must be in available lifecycle state. Use `dependsOn` to explicitly declare this dependency. See [Using Amazon EFS with Lambda][12]. + +* `arn` - (Required) Amazon Resource Name (ARN) of the Amazon EFS Access Point that provides access to the file system. +* `localMountPath` - (Required) Path where the function can access the file system, starting with /mnt/. + +### image_config + +Container image configuration values that override the values in the container image Dockerfile. + +* `command` - (Optional) Parameters that you want to pass in with `entryPoint`. +* `entryPoint` - (Optional) Entry point to your application, which is typically the location of the runtime executable. +* `workingDirectory` - (Optional) Working directory. + +### snap_start + +Snap start settings for low-latency startups. This feature is currently only supported for `java11` runtimes. Remove this block to delete the associated settings (rather than setting `apply_on = "None"`). + +* `applyOn` - (Required) Conditions where snap start is enabled. Valid values are `publishedVersions`. + +### tracing_config + +* `mode` - (Required) Whether to sample and trace a subset of incoming requests with AWS X-Ray. Valid values are `passThrough` and `active`. If `passThrough`, Lambda will only trace the request from an upstream service if it contains a tracing header with "sampled=1". If `active`, Lambda will respect any tracing header it receives from an upstream service. If no tracing header is received, Lambda will call X-Ray for a tracing decision. + +### vpc_config + +For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can only access resources and the internet through that VPC. See [VPC Settings][7]. + +~> **NOTE:** If both `subnetIds` and `securityGroupIds` are empty then `vpcConfig` is considered to be empty or unset. + +* `securityGroupIds` - (Required) List of security group IDs associated with the Lambda function. +* `subnetIds` - (Required) List of subnet IDs associated with the Lambda function. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) identifying your Lambda Function. +* `invokeArn` - ARN to be used for invoking Lambda Function from API Gateway - to be used in [`awsApiGatewayIntegration`](/docs/providers/aws/r/api_gateway_integration.html)'s `uri`. +* `lastModified` - Date this resource was last modified. +* `qualifiedArn` - ARN identifying your Lambda Function Version (if versioning is enabled via `publish = true`). +* `qualifiedInvokeArn` - Qualified ARN (ARN with lambda version number) to be used for invoking Lambda Function from API Gateway - to be used in [`awsApiGatewayIntegration`](/docs/providers/aws/r/api_gateway_integration.html)'s `uri`. +* `signingJobArn` - ARN of the signing job. +* `signingProfileVersionArn` - ARN of the signing profile version. +* `snapStartOptimizationStatus` - Optimization status of the snap start configuration. Valid values are `on` and `off`. +* `sourceCodeSize` - Size in bytes of the function .zip file. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). +* `version` - Latest published version of your Lambda Function. +* `vpcConfigVpcId` - ID of the VPC. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/welcome.html +[3]: https://docs.aws.amazon.com/lambda/latest/dg/walkthrough-custom-events-create-test-function.html +[4]: https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html +[5]: https://docs.aws.amazon.com/lambda/latest/dg/limits.html +[6]: https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-Runtime +[7]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html +[8]: https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html +[9]: https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html +[10]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html +[11]: https://learn.hashicorp.com/terraform/aws/lambda-api-gateway +[12]: https://docs.aws.amazon.com/lambda/latest/dg/services-efs.html + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `10M`) +* `update` - (Default `10M`) +* `delete` - (Default `10M`) + +## Import + +Lambda Functions can be imported using the `functionName`, e.g., + +``` +$ terraform import aws_lambda_function.test_lambda my_test_lambda_function +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_function_event_invoke_config.html.markdown b/website/docs/cdktf/typescript/r/lambda_function_event_invoke_config.html.markdown new file mode 100644 index 00000000000..69960c6c67b --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_function_event_invoke_config.html.markdown @@ -0,0 +1,210 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function_event_invoke_config" +description: |- + Manages an asynchronous invocation configuration for a Lambda Function or Alias. +--- + + + +# Resource: aws_lambda_function_event_invoke_config + +Manages an asynchronous invocation configuration for a Lambda Function or Alias. More information about asynchronous invocations and the configurable values can be found in the [Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html). + +## Example Usage + +### Destination Configuration + +~> **NOTE:** Ensure the Lambda Function IAM Role has necessary permissions for the destination, such as `sqs:sendMessage` or `sns:publish`, otherwise the API will return a generic `InvalidParameterValueException: The destination ARN arn:PARTITION:SERVICE:REGION:ACCOUNT:RESOURCE is invalid.` error. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaFunctionEventInvokeConfig } from "./.gen/providers/aws/lambda-function-event-invoke-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaFunctionEventInvokeConfig(this, "example", { + destinationConfig: { + onFailure: { + destination: Token.asString(awsSqsQueueExample.arn), + }, + onSuccess: { + destination: Token.asString(awsSnsTopicExample.arn), + }, + }, + functionName: Token.asString(awsLambdaAliasExample.functionName), + }); + } +} + +``` + +### Error Handling Configuration + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaFunctionEventInvokeConfig } from "./.gen/providers/aws/lambda-function-event-invoke-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaFunctionEventInvokeConfig(this, "example", { + functionName: Token.asString(awsLambdaAliasExample.functionName), + maximumEventAgeInSeconds: 60, + maximumRetryAttempts: 0, + }); + } +} + +``` + +### Configuration for Alias Name + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaFunctionEventInvokeConfig } from "./.gen/providers/aws/lambda-function-event-invoke-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaFunctionEventInvokeConfig(this, "example", { + functionName: Token.asString(awsLambdaAliasExample.functionName), + qualifier: Token.asString(awsLambdaAliasExample.name), + }); + } +} + +``` + +### Configuration for Function Latest Unpublished Version + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaFunctionEventInvokeConfig } from "./.gen/providers/aws/lambda-function-event-invoke-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaFunctionEventInvokeConfig(this, "example", { + functionName: Token.asString(awsLambdaFunctionExample.functionName), + qualifier: "$LATEST", + }); + } +} + +``` + +### Configuration for Function Published Version + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaFunctionEventInvokeConfig } from "./.gen/providers/aws/lambda-function-event-invoke-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaFunctionEventInvokeConfig(this, "example", { + functionName: Token.asString(awsLambdaFunctionExample.functionName), + qualifier: Token.asString(awsLambdaFunctionExample.version), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `functionName` - (Required) Name or Amazon Resource Name (ARN) of the Lambda Function, omitting any version or alias qualifier. + +The following arguments are optional: + +* `destinationConfig` - (Optional) Configuration block with destination configuration. See below for details. +* `maximumEventAgeInSeconds` - (Optional) Maximum age of a request that Lambda sends to a function for processing in seconds. Valid values between 60 and 21600. +* `maximumRetryAttempts` - (Optional) Maximum number of times to retry when the function returns an error. Valid values between 0 and 2. Defaults to 2. +* `qualifier` - (Optional) Lambda Function published version, `$latest`, or Lambda Alias name. + +### destination_config Configuration Block + +~> **NOTE:** At least one of `onFailure` or `onSuccess` must be configured when using this configuration block, otherwise remove it completely to prevent perpetual differences in Terraform runs. + +The following arguments are optional: + +* `onFailure` - (Optional) Configuration block with destination configuration for failed asynchronous invocations. See below for details. +* `onSuccess` - (Optional) Configuration block with destination configuration for successful asynchronous invocations. See below for details. + +#### destination_config on_failure Configuration Block + +The following arguments are required: + +* `destination` - (Required) Amazon Resource Name (ARN) of the destination resource. See the [Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations) for acceptable resource types and associated IAM permissions. + +#### destination_config on_success Configuration Block + +The following arguments are required: + +* `destination` - (Required) Amazon Resource Name (ARN) of the destination resource. See the [Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations) for acceptable resource types and associated IAM permissions. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - Fully qualified Lambda Function name or Amazon Resource Name (ARN) + +## Import + +Lambda Function Event Invoke Configs can be imported using the fully qualified Function name or Amazon Resource Name (ARN), e.g., + +ARN without qualifier (all versions and aliases): + +``` +$ terraform import aws_lambda_function_event_invoke_config.example arn:aws:us-east-1:123456789012:function:my_function +``` + +ARN with qualifier: + +``` +$ terraform import aws_lambda_function_event_invoke_config.example arn:aws:us-east-1:123456789012:function:my_function:production +``` + +Name without qualifier (all versions and aliases): + +``` +$ terraform import aws_lambda_function_event_invoke_config.example my_function +``` + +Name with qualifier: + +``` +$ terraform import aws_lambda_function_event_invoke_config.example my_function:production +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_function_url.html.markdown b/website/docs/cdktf/typescript/r/lambda_function_url.html.markdown new file mode 100644 index 00000000000..93aed718555 --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_function_url.html.markdown @@ -0,0 +1,88 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_function_url" +description: |- + Provides a Lambda function URL resource. +--- + + + +# Resource: aws_lambda_function_url + +Provides a Lambda function URL resource. A function URL is a dedicated HTTP(S) endpoint for a Lambda function. + +See the [AWS Lambda documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) for more information. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaFunctionUrl } from "./.gen/providers/aws/lambda-function-url"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaFunctionUrl(this, "test_latest", { + authorizationType: "NONE", + functionName: test.functionName, + }); + new LambdaFunctionUrl(this, "test_live", { + authorizationType: "AWS_IAM", + cors: { + allowCredentials: true, + allowHeaders: ["date", "keep-alive"], + allowMethods: ["*"], + allowOrigins: ["*"], + exposeHeaders: ["keep-alive", "date"], + maxAge: 86400, + }, + functionName: test.functionName, + qualifier: "my_alias", + }); + } +} + +``` + +## Argument Reference + +* `authorizationType` - (Required) The type of authentication that the function URL uses. Set to `"awsIam"` to restrict access to authenticated IAM users only. Set to `"none"` to bypass IAM authentication and create a public endpoint. See the [AWS documentation](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html) for more details. +* `cors` - (Optional) The [cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for the function URL. Documented below. +* `functionName` - (Required) The name (or ARN) of the Lambda function. +* `invokeMode` - (Optional) Determines how the Lambda function responds to an invocation. Valid values are `buffered` (default) and `responseStream`. See more in [Configuring a Lambda function to stream responses](https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html). +* `qualifier` - (Optional) The alias name or `"$latest"`. + +### cors + +This configuration block supports the following attributes: + +* `allowCredentials` - (Optional) Whether to allow cookies or other credentials in requests to the function URL. The default is `false`. +* `allowHeaders` - (Optional) The HTTP headers that origins can include in requests to the function URL. For example: `["date", "keep-alive", "x-custom-header"]`. +* `allowMethods` - (Optional) The HTTP methods that are allowed when calling the function URL. For example: `["GET", "POST", "DELETE"]`, or the wildcard character (`["*"]`). +* `allowOrigins` - (Optional) The origins that can access the function URL. You can list any number of specific origins (or the wildcard character (`"*"`)), separated by a comma. For example: `["https://www.example.com", "http://localhost:60905"]`. +* `exposeHeaders` - (Optional) The HTTP headers in your function response that you want to expose to origins that call the function URL. +* `maxAge` - (Optional) The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to `0`, which means that the browser doesn't cache results. The maximum value is `86400`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `functionArn` - The Amazon Resource Name (ARN) of the function. +* `functionUrl` - The HTTP URL endpoint for the function in the format `https://LambdaUrl.OnAws`. +* `urlId` - A generated ID for the endpoint. + +## Import + +Lambda function URLs can be imported using the `functionName` or `functionName/qualifier`, e.g., + +``` +$ terraform import aws_lambda_function_url.test_lambda_url my_test_lambda_function +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_invocation.html.markdown b/website/docs/cdktf/typescript/r/lambda_invocation.html.markdown new file mode 100644 index 00000000000..7533d94e305 --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_invocation.html.markdown @@ -0,0 +1,196 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_invocation" +description: |- + Invoke AWS Lambda Function +--- + + + +# Resource: aws_lambda_invocation + +Use this resource to invoke a lambda function. The lambda function is invoked with the [RequestResponse](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) invocation type. + +~> **NOTE:** By default this resource _only_ invokes the function when the arguments call for a create or replace. In other words, after an initial invocation on _apply_, if the arguments do not change, a subsequent _apply_ does not invoke the function again. To dynamically invoke the function, see the `triggers` example below. To always invoke a function on each _apply_, see the [`awsLambdaInvocation`](/docs/providers/aws/d/lambda_invocation.html) data source. To invoke the lambda function when the terraform resource is updated and deleted, see the [CRUD Lifecycle Scope](#crud-lifecycle-scope) example below. + +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`awsLambdaFunction`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + +## Example Usage + +### Basic Example + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + Fn, + Token, + TerraformOutput, + propertyAccess, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaInvocation } from "./.gen/providers/aws/lambda-invocation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new LambdaInvocation(this, "example", { + functionName: lambdaFunctionTest.functionName, + input: Token.asString( + Fn.jsonencode({ + key1: "value1", + key2: "value2", + }) + ), + }); + new TerraformOutput(this, "result_entry", { + value: propertyAccess(Fn.jsondecode(example.result), ['"key1"']), + }); + } +} + +``` + +### Dynamic Invocation Example Using Triggers + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaInvocation } from "./.gen/providers/aws/lambda-invocation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaInvocation(this, "example", { + functionName: lambdaFunctionTest.functionName, + input: Token.asString( + Fn.jsonencode({ + key1: "value1", + key2: "value2", + }) + ), + triggers: { + redeployment: Token.asString( + Fn.sha1( + Token.asString( + Fn.jsonencode([awsLambdaFunctionExample.environment]) + ) + ) + ), + }, + }); + } +} + +``` + +### CRUD Lifecycle Scope + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaInvocation } from "./.gen/providers/aws/lambda-invocation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaInvocation(this, "example", { + functionName: lambdaFunctionTest.functionName, + input: Token.asString( + Fn.jsonencode({ + key1: "value1", + key2: "value2", + }) + ), + lifecycleScope: "CRUD", + }); + } +} + +``` + +~> **NOTE:** `lifecycle_scope = "CRUD"` will inject a key `tf` in the input event to pass lifecycle information! This allows the lambda function to handle different lifecycle transitions uniquely. If you need to use a key `tf` in your own input JSON, the default key name can be overridden with the `terraformKey` argument. + +The key `tf` gets added with subkeys: + +* `action` - Action Terraform performs on the resource. Values are `create`, `update`, or `delete`. +* `prevInput` - Input JSON payload from the previous invocation. This can be used to handle update and delete events. + +When the resource from the example above is created, the Lambda will get following JSON payload: + +```json +{ + "key1": "value1", + "key2": "value2", + "tf": { + "action": "create", + "prev_input": null + } +} +``` + +If the input value of `key1` changes to "valueB", then the lambda will be invoked again with the following JSON payload: + +```json +{ + "key1": "valueB", + "key2": "value2", + "tf": { + "action": "update", + "prev_input": { + "key1": "value1", + "key2": "value2" + } + } +} +``` + +When the invocation resource is removed, the final invocation will have the following JSON payload: + +```json +{ + "key1": "valueB", + "key2": "value2", + "tf": { + "action": "delete", + "prev_input": { + "key1": "valueB", + "key2": "value2" + } + } +} +``` + +## Argument Reference + +The following arguments are required: + +* `functionName` - (Required) Name of the lambda function. +* `input` - (Required) JSON payload to the lambda function. + +The following arguments are optional: + +* `lifecycleScope` - (Optional) Lifecycle scope of the resource to manage. Valid values are `createOnly` and `crud`. Defaults to `createOnly`. `createOnly` will invoke the function only on creation or replacement. `crud` will invoke the function on each lifecycle event, and augment the input JSON payload with additional lifecycle information. +* `qualifier` - (Optional) Qualifier (i.e., version) of the lambda function. Defaults to `$latest`. +* `terraformKey` - (Optional) The JSON key used to store lifecycle information in the input JSON payload. Defaults to `tf`. This additional key is only included when `lifecycleScope` is set to `crud`. +* `triggers` - (Optional) Map of arbitrary keys and values that, when changed, will trigger a re-invocation. To force a re-invocation without changing these keys/values, use the [`terraform taint` command](https://www.terraform.io/docs/commands/taint.html). + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `result` - String result of the lambda function invocation. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_layer_version.html.markdown b/website/docs/cdktf/typescript/r/lambda_layer_version.html.markdown new file mode 100644 index 00000000000..11a639fc99e --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_layer_version.html.markdown @@ -0,0 +1,100 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_layer_version" +description: |- + Provides a Lambda Layer Version resource. Lambda Layers allow you to reuse shared bits of code across multiple lambda functions. +--- + + + +# Resource: aws_lambda_layer_version + +Provides a Lambda Layer Version resource. Lambda Layers allow you to reuse shared bits of code across multiple lambda functions. + +For information about Lambda Layers and how to use them, see [AWS Lambda Layers][1]. + +~> **NOTE:** Setting `skipDestroy` to `true` means that the AWS Provider will _not_ destroy any layer version, even when running `terraform destroy`. Layer versions are thus intentional dangling resources that are _not_ managed by Terraform and may incur extra expense in your AWS account. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaLayerVersion } from "./.gen/providers/aws/lambda-layer-version"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaLayerVersion(this, "lambda_layer", { + compatibleRuntimes: ["nodejs16.x"], + filename: "lambda_layer_payload.zip", + layerName: "lambda_layer_name", + }); + } +} + +``` + +## Specifying the Deployment Package + +AWS Lambda Layers expect source code to be provided as a deployment package whose structure varies depending on which `compatibleRuntimes` this layer specifies. +See [Runtimes][2] for the valid values of `compatibleRuntimes`. + +Once you have created your deployment package you can specify it either directly as a local file (using the `filename` argument) or +indirectly via Amazon S3 (using the `s3Bucket`, `s3Key` and `s3ObjectVersion` arguments). When providing the deployment +package via S3 it may be useful to use [the `awsS3Object` resource](s3_object.html) to upload it. + +For larger deployment packages it is recommended by Amazon to upload via S3, since the S3 API has better support for uploading large files efficiently. + +## Argument Reference + +The following arguments are required: + +* `layerName` - (Required) Unique name for your Lambda Layer + +The following arguments are optional: + +* `compatibleArchitectures` - (Optional) List of [Architectures][4] this layer is compatible with. Currently `x8664` and `arm64` can be specified. +* `compatibleRuntimes` - (Optional) List of [Runtimes][2] this layer is compatible with. Up to 5 runtimes can be specified. +* `description` - (Optional) Description of what your Lambda Layer does. +* `filename` (Optional) Path to the function's deployment package within the local filesystem. If defined, The `s3`-prefixed options cannot be used. +* `licenseInfo` - (Optional) License info for your Lambda Layer. See [License Info][3]. +* `s3Bucket` - (Optional) S3 bucket location containing the function's deployment package. Conflicts with `filename`. This bucket must reside in the same AWS region where you are creating the Lambda function. +* `s3Key` - (Optional) S3 key of an object containing the function's deployment package. Conflicts with `filename`. +* `s3ObjectVersion` - (Optional) Object version containing the function's deployment package. Conflicts with `filename`. +* `skipDestroy` - (Optional) Whether to retain the old version of a previously deployed Lambda Layer. Default is `false`. When this is not set to `true`, changing any of `compatibleArchitectures`, `compatibleRuntimes`, `description`, `filename`, `layerName`, `licenseInfo`, `s3Bucket`, `s3Key`, `s3ObjectVersion`, or `sourceCodeHash` forces deletion of the existing layer version and creation of a new layer version. +* `sourceCodeHash` - (Optional) Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either `filename` or `s3Key`. The usual way to set this is `${filebase64Sha256("fileZip")}` (Terraform 0.11.12 or later) or `${base64Sha256(file("fileZip"))}` (Terraform 0.11.11 and earlier), where "file.zip" is the local filename of the lambda layer source archive. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the Lambda Layer with version. +* `createdDate` - Date this resource was created. +* `layerArn` - ARN of the Lambda Layer without version. +* `signingJobArn` - ARN of a signing job. +* `signingProfileVersionArn` - ARN for a signing profile version. +* `sourceCodeSize` - Size in bytes of the function .zip file. +* `version` - Lambda Layer version. + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html +[2]: https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-CompatibleRuntimes +[3]: https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-LicenseInfo +[4]: https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-CompatibleArchitectures + +## Import + +Lambda Layers can be imported using `arn`. + +``` +$ terraform import \ + aws_lambda_layer_version.test_layer \ + arn:aws:lambda:_REGION_:_ACCOUNT_ID_:layer:_LAYER_NAME_:_LAYER_VERSION_ +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_layer_version_permission.html.markdown b/website/docs/cdktf/typescript/r/lambda_layer_version_permission.html.markdown new file mode 100644 index 00000000000..0579fbeb0be --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_layer_version_permission.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_layer_version_permission" +description: |- + Provides a Lambda Layer Version Permission resource. +--- + + + +# Resource: aws_lambda_layer_version_permission + +Provides a Lambda Layer Version Permission resource. It allows you to share you own Lambda Layers to another account by account ID, to all accounts in AWS organization or even to all AWS accounts. + +For information about Lambda Layer Permissions and how to use them, see [Using Resource-based Policies for AWS Lambda][1] + +~> **NOTE:** Setting `skipDestroy` to `true` means that the AWS Provider will _not_ destroy any layer version permission, even when running `terraform destroy`. Layer version permissions are thus intentional dangling resources that are _not_ managed by Terraform and may incur extra expense in your AWS account. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaLayerVersionPermission } from "./.gen/providers/aws/lambda-layer-version-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaLayerVersionPermission(this, "lambda_layer_permission", { + action: "lambda:GetLayerVersion", + layerName: "arn:aws:lambda:us-west-2:123456654321:layer:test_layer1", + principal: "111111111111", + statementId: "dev-account", + versionNumber: 1, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `action` - (Required) Action, which will be allowed. `lambda:getLayerVersion` value is suggested by AWS documantation. +* `layerName` (Required) The name or ARN of the Lambda Layer, which you want to grant access to. +* `organizationId` - (Optional) An identifier of AWS Organization, which should be able to use your Lambda Layer. `principal` should be equal to `*` if `organizationId` provided. +* `principal` - (Required) AWS account ID which should be able to use your Lambda Layer. `*` can be used here, if you want to share your Lambda Layer widely. +* `statementId` - (Required) The name of Lambda Layer Permission, for example `devAccount` - human readable note about what is this permission for. +* `versionNumber` (Required) Version of Lambda Layer, which you want to grant access to. Note: permissions only apply to a single version of a layer. +* `skipDestroy` - (Optional) Whether to retain the old version of a previously deployed Lambda Layer. Default is `false`. When this is not set to `true`, changing any of `compatibleArchitectures`, `compatibleRuntimes`, `description`, `filename`, `layerName`, `licenseInfo`, `s3Bucket`, `s3Key`, `s3ObjectVersion`, or `sourceCodeHash` forces deletion of the existing layer version and creation of a new layer version. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The `layerName` and `versionNumber`, separated by a comma (`,`). +* `revisionId` - A unique identifier for the current revision of the policy. +* `policy` - Full Lambda Layer Permission policy. + +## Import + +Lambda Layer Permissions can be imported using `layerName` and `versionNumber`, separated by a comma (`,`). + +```sh +$ terraform import aws_lambda_layer_version_permission.example arn:aws:lambda:us-west-2:123456654321:layer:test_layer1,1 +``` + +[1]: https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html#permissions-resource-xaccountlayer + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_permission.html.markdown b/website/docs/cdktf/typescript/r/lambda_permission.html.markdown new file mode 100644 index 00000000000..bdb1119daea --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_permission.html.markdown @@ -0,0 +1,345 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_permission" +description: |- + Creates a Lambda function permission. +--- + + + +# Resource: aws_lambda_permission + +Gives an external source (like an EventBridge Rule, SNS, or S3) permission to access the Lambda function. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { LambdaAlias } from "./.gen/providers/aws/lambda-alias"; +import { LambdaFunction } from "./.gen/providers/aws/lambda-function"; +import { LambdaPermission } from "./.gen/providers/aws/lambda-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const iamForLambda = new IamRole(this, "iam_for_lambda", { + assumeRolePolicy: Token.asString( + Fn.jsonencode({ + Statement: [ + { + Action: "sts:AssumeRole", + Effect: "Allow", + Principal: { + Service: "lambda.amazonaws.com", + }, + Sid: "", + }, + ], + Version: "2012-10-17", + }) + ), + name: "iam_for_lambda", + }); + const testLambda = new LambdaFunction(this, "test_lambda", { + filename: "lambdatest.zip", + functionName: "lambda_function_name", + handler: "exports.handler", + role: iamForLambda.arn, + runtime: "nodejs16.x", + }); + const testAlias = new LambdaAlias(this, "test_alias", { + description: "a sample description", + functionName: testLambda.functionName, + functionVersion: "$LATEST", + name: "testalias", + }); + new LambdaPermission(this, "allow_cloudwatch", { + action: "lambda:InvokeFunction", + functionName: testLambda.functionName, + principal: "events.amazonaws.com", + qualifier: testAlias.name, + sourceArn: "arn:aws:events:eu-west-1:111122223333:rule/RunDaily", + statementId: "AllowExecutionFromCloudWatch", + }); + } +} + +``` + +### With SNS + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { LambdaFunction } from "./.gen/providers/aws/lambda-function"; +import { LambdaPermission } from "./.gen/providers/aws/lambda-permission"; +import { SnsTopic } from "./.gen/providers/aws/sns-topic"; +import { SnsTopicSubscription } from "./.gen/providers/aws/sns-topic-subscription"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const defaultVar = new IamRole(this, "default", { + assumeRolePolicy: Token.asString( + Fn.jsonencode({ + Statement: [ + { + Action: "sts:AssumeRole", + Effect: "Allow", + Principal: { + Service: "lambda.amazonaws.com", + }, + Sid: "", + }, + ], + Version: "2012-10-17", + }) + ), + name: "iam_for_lambda_with_sns", + }); + const func = new LambdaFunction(this, "func", { + filename: "lambdatest.zip", + functionName: "lambda_called_from_sns", + handler: "exports.handler", + role: defaultVar.arn, + runtime: "python3.7", + }); + const awsSnsTopicDefault = new SnsTopic(this, "default_2", { + name: "call-lambda-maybe", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsSnsTopicDefault.overrideLogicalId("default"); + new SnsTopicSubscription(this, "lambda", { + endpoint: func.arn, + protocol: "lambda", + topicArn: Token.asString(awsSnsTopicDefault.arn), + }); + new LambdaPermission(this, "with_sns", { + action: "lambda:InvokeFunction", + functionName: func.functionName, + principal: "sns.amazonaws.com", + sourceArn: Token.asString(awsSnsTopicDefault.arn), + statementId: "AllowExecutionFromSNS", + }); + } +} + +``` + +### With API Gateway REST API + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { ApiGatewayRestApi } from "./.gen/providers/aws/api-gateway-rest-api"; +import { LambdaPermission } from "./.gen/providers/aws/lambda-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const myDemoApi = new ApiGatewayRestApi(this, "MyDemoAPI", { + description: "This is my API for demonstration purposes", + name: "MyDemoAPI", + }); + new LambdaPermission(this, "lambda_permission", { + action: "lambda:InvokeFunction", + functionName: "MyDemoFunction", + principal: "apigateway.amazonaws.com", + sourceArn: "${" + myDemoApi.executionArn + "}/*", + statementId: "AllowMyDemoAPIInvoke", + }); + } +} + +``` + +### With CloudWatch Log Group + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { CloudwatchLogGroup } from "./.gen/providers/aws/cloudwatch-log-group"; +import { CloudwatchLogSubscriptionFilter } from "./.gen/providers/aws/cloudwatch-log-subscription-filter"; +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { IamRole } from "./.gen/providers/aws/iam-role"; +import { LambdaFunction } from "./.gen/providers/aws/lambda-function"; +import { LambdaPermission } from "./.gen/providers/aws/lambda-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const defaultVar = new CloudwatchLogGroup(this, "default", { + name: "/default", + }); + const assumeRole = new DataAwsIamPolicyDocument(this, "assume_role", { + statement: [ + { + actions: ["sts:AssumeRole"], + effect: "Allow", + principals: [ + { + identifiers: ["lambda.amazonaws.com"], + type: "Service", + }, + ], + }, + ], + }); + const awsIamRoleDefault = new IamRole(this, "default_2", { + assumeRolePolicy: Token.asString(assumeRole.json), + name: "iam_for_lambda_called_from_cloudwatch_logs", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsIamRoleDefault.overrideLogicalId("default"); + const logging = new LambdaFunction(this, "logging", { + filename: "lamba_logging.zip", + functionName: "lambda_called_from_cloudwatch_logs", + handler: "exports.handler", + role: Token.asString(awsIamRoleDefault.arn), + runtime: "python3.7", + }); + const awsLambdaPermissionLogging = new LambdaPermission(this, "logging_4", { + action: "lambda:InvokeFunction", + functionName: logging.functionName, + principal: "logs.eu-west-1.amazonaws.com", + sourceArn: "${" + defaultVar.arn + "}:*", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsLambdaPermissionLogging.overrideLogicalId("logging"); + const awsCloudwatchLogSubscriptionFilterLogging = + new CloudwatchLogSubscriptionFilter(this, "logging_5", { + dependsOn: [awsLambdaPermissionLogging], + destinationArn: logging.arn, + filterPattern: "", + logGroupName: defaultVar.name, + name: "logging_default", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsCloudwatchLogSubscriptionFilterLogging.overrideLogicalId("logging"); + } +} + +``` + +### With Cross-Account Invocation Policy + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaFunctionUrl } from "./.gen/providers/aws/lambda-function-url"; +import { LambdaPermission } from "./.gen/providers/aws/lambda-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaFunctionUrl(this, "url", { + authorizationType: "AWS_IAM", + functionName: example.functionName, + }); + const awsLambdaPermissionUrl = new LambdaPermission(this, "url_1", { + action: "lambda:InvokeFunctionUrl", + functionName: example.functionName, + functionUrlAuthType: "AWS_IAM", + principal: "arn:aws:iam::444455556666:role/example", + sourceAccount: "444455556666", + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsLambdaPermissionUrl.overrideLogicalId("url"); + } +} + +``` + +### With `replaceTriggeredBy` Lifecycle Configuration + +If omitting the `qualifier` argument (which forces re-creation each time a function version is published), a `lifecycle` block can be used to ensure permissions are re-applied on any change to the underlying function. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaPermission } from "./.gen/providers/aws/lambda-permission"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaPermission(this, "logging", { + action: "lambda:InvokeFunction", + functionName: example.functionName, + lifecycle: { + replaceTriggeredBy: [example], + }, + principal: "events.amazonaws.com", + sourceArn: "arn:aws:events:eu-west-1:111122223333:rule/RunDaily", + }); + } +} + +``` + +## Argument Reference + +* `action` - (Required) The AWS Lambda action you want to allow in this statement. (e.g., `lambda:invokeFunction`) +* `eventSourceToken` - (Optional) The Event Source Token to validate. Used with [Alexa Skills][1]. +* `functionName` - (Required) Name of the Lambda function whose resource policy you are updating +* `functionUrlAuthType` - (Optional) Lambda Function URLs [authentication type][3]. Valid values are: `awsIam` or `none`. Only supported for `lambda:invokeFunctionUrl` action. +* `principal` - (Required) The principal who is getting this permission e.g., `s3AmazonawsCom`, an AWS account ID, or AWS IAM principal, or AWS service principal such as `eventsAmazonawsCom` or `snsAmazonawsCom`. +* `qualifier` - (Optional) Query parameter to specify function version or alias name. The permission will then apply to the specific qualified ARN e.g., `arn:aws:lambda:awsRegion:acctId:function:functionName:2` +* `sourceAccount` - (Optional) This parameter is used when allowing cross-account access, or for S3 and SES. The AWS account ID (without a hyphen) of the source owner. +* `sourceArn` - (Optional) When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to. + Without this, any resource from `principal` will be granted permission – even if that resource is from another account. + For S3, this should be the ARN of the S3 Bucket. + For EventBridge events, this should be the ARN of the EventBridge Rule. + For API Gateway, this should be the ARN of the API, as described [here][2]. +* `statementId` - (Optional) A unique statement identifier. By default generated by Terraform. +* `statementIdPrefix` - (Optional) A statement identifier prefix. Terraform will generate a unique suffix. Conflicts with `statementId`. +* `principalOrgId` - (Optional) The identifier for your organization in AWS Organizations. Use this to grant permissions to all the AWS accounts under this organization. + +[1]: https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html#use-aws-cli +[2]: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-control-access-using-iam-policies-to-invoke-api.html +[3]: https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html + +## Attributes Reference + +No additional attributes are exported. + +## Import + +Lambda permission statements can be imported using function_name/statement_id, with an optional qualifier, e.g., + +``` +$ terraform import aws_lambda_permission.test_lambda_permission my_test_lambda_function/AllowExecutionFromCloudWatch + +$ terraform import aws_lambda_permission.test_lambda_permission my_test_lambda_function:qualifier_name/AllowExecutionFromCloudWatch +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/lambda_provisioned_concurrency_config.html.markdown b/website/docs/cdktf/typescript/r/lambda_provisioned_concurrency_config.html.markdown new file mode 100644 index 00000000000..a920e635f57 --- /dev/null +++ b/website/docs/cdktf/typescript/r/lambda_provisioned_concurrency_config.html.markdown @@ -0,0 +1,100 @@ +--- +subcategory: "Lambda" +layout: "aws" +page_title: "AWS: aws_lambda_provisioned_concurrency_config" +description: |- + Manages a Lambda Provisioned Concurrency Configuration +--- + + + +# Resource: aws_lambda_provisioned_concurrency_config + +Manages a Lambda Provisioned Concurrency Configuration. + +~> **NOTE:** Setting `skipDestroy` to `true` means that the AWS Provider will _not_ destroy a provisioned concurrency configuration, even when running `terraform destroy`. The configuration is thus an intentional dangling resource that is _not_ managed by Terraform and may incur extra expense in your AWS account. + +## Example Usage + +### Alias Name + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaProvisionedConcurrencyConfig } from "./.gen/providers/aws/lambda-provisioned-concurrency-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaProvisionedConcurrencyConfig(this, "example", { + functionName: Token.asString(awsLambdaAliasExample.functionName), + provisionedConcurrentExecutions: 1, + qualifier: Token.asString(awsLambdaAliasExample.name), + }); + } +} + +``` + +### Function Version + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { LambdaProvisionedConcurrencyConfig } from "./.gen/providers/aws/lambda-provisioned-concurrency-config"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new LambdaProvisionedConcurrencyConfig(this, "example", { + functionName: Token.asString(awsLambdaFunctionExample.functionName), + provisionedConcurrentExecutions: 1, + qualifier: Token.asString(awsLambdaFunctionExample.version), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `functionName` - (Required) Name or Amazon Resource Name (ARN) of the Lambda Function. +* `provisionedConcurrentExecutions` - (Required) Amount of capacity to allocate. Must be greater than or equal to `1`. +* `qualifier` - (Required) Lambda Function version or Lambda Alias name. + +The following arguments are optional: + +* `skipDestroy` - (Optional) Whether to retain the provisoned concurrency configuration upon destruction. Defaults to `false`. If set to `true`, the resource in simply removed from state instead. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - Lambda Function name and qualifier separated by a comma (`,`). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `15M`) +* `update` - (Default `15M`) + +## Import + +A Lambda Provisioned Concurrency Configuration can be imported using the `functionName` and `qualifier` separated by a comma (`,`), e.g., + +``` +$ terraform import aws_lambda_provisioned_concurrency_config.example my_function,production +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc.html.markdown b/website/docs/cdktf/typescript/r/vpc.html.markdown new file mode 100644 index 00000000000..6151353849b --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc.html.markdown @@ -0,0 +1,163 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc" +description: |- + Provides a VPC resource. +--- + + + +# Resource: aws_vpc + +Provides a VPC resource. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Vpc } from "./.gen/providers/aws/vpc"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Vpc(this, "main", { + cidrBlock: "10.0.0.0/16", + }); + } +} + +``` + +Basic usage with tags: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Vpc } from "./.gen/providers/aws/vpc"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new Vpc(this, "main", { + cidrBlock: "10.0.0.0/16", + instanceTenancy: "default", + tags: { + Name: "main", + }, + }); + } +} + +``` + +VPC with CIDR from AWS IPAM: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamPool } from "./.gen/providers/aws/vpc-ipam-pool"; +import { VpcIpamPoolCidr } from "./.gen/providers/aws/vpc-ipam-pool-cidr"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const test = new VpcIpam(this, "test", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const awsVpcIpamPoolTest = new VpcIpamPool(this, "test_2", { + addressFamily: "ipv4", + ipamScopeId: test.privateDefaultScopeId, + locale: Token.asString(current.name), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolTest.overrideLogicalId("test"); + const awsVpcIpamPoolCidrTest = new VpcIpamPoolCidr(this, "test_3", { + cidr: "172.2.0.0/16", + ipamPoolId: Token.asString(awsVpcIpamPoolTest.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrTest.overrideLogicalId("test"); + const awsVpcTest = new Vpc(this, "test_4", { + dependsOn: [awsVpcIpamPoolCidrTest], + ipv4IpamPoolId: Token.asString(awsVpcIpamPoolTest.id), + ipv4NetmaskLength: 28, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcTest.overrideLogicalId("test"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `cidrBlock` - (Optional) The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv4NetmaskLength`. +* `instanceTenancy` - (Optional) A tenancy option for instances launched into the VPC. Default is `default`, which ensures that EC2 instances launched in this VPC use the EC2 instance tenancy attribute specified when the EC2 instance is launched. The only other option is `dedicated`, which ensures that EC2 instances launched in this VPC are run on dedicated tenancy instances regardless of the tenancy attribute specified at launch. This has a dedicated per region fee of $2 per hour, plus an hourly per instance usage fee. +* `ipv4IpamPoolId` - (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization. +* `ipv4NetmaskLength` - (Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a `ipv4IpamPoolId`. +* `ipv6CidrBlock` - (Optional) IPv6 CIDR block to request from an IPAM Pool. Can be set explicitly or derived from IPAM using `ipv6NetmaskLength`. +* `ipv6IpamPoolId` - (Optional) IPAM Pool ID for a IPv6 pool. Conflicts with `assignGeneratedIpv6CidrBlock`. +* `ipv6NetmaskLength` - (Optional) Netmask length to request from IPAM Pool. Conflicts with `ipv6CidrBlock`. This can be omitted if IPAM pool as a `allocationDefaultNetmaskLength` set. Valid values: `56`. +* `ipv6CidrBlockNetworkBorderGroup` - (Optional) By default when an IPv6 CIDR is assigned to a VPC a default ipv6_cidr_block_network_border_group will be set to the region of the VPC. This can be changed to restrict advertisement of public addresses to specific Network Border Groups such as LocalZones. +* `enableDnsSupport` - (Optional) A boolean flag to enable/disable DNS support in the VPC. Defaults to true. +* `enableNetworkAddressUsageMetrics` - (Optional) Indicates whether Network Address Usage metrics are enabled for your VPC. Defaults to false. +* `enableDnsHostnames` - (Optional) A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false. +* `assignGeneratedIpv6CidrBlock` - (Optional) Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is `false`. Conflicts with `ipv6IpamPoolId` +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of VPC +* `id` - The ID of the VPC +* `instanceTenancy` - Tenancy of instances spin up within VPC +* `enableDnsSupport` - Whether or not the VPC has DNS support +* `enableNetworkAddressUsageMetrics` - Whether Network Address Usage metrics are enabled for the VPC +* `enableDnsHostnames` - Whether or not the VPC has DNS hostname support +* `mainRouteTableId` - The ID of the main route table associated with + this VPC. Note that you can change a VPC's main route table by using an + [`awsMainRouteTableAssociation`](/docs/providers/aws/r/main_route_table_association.html). +* `defaultNetworkAclId` - The ID of the network ACL created by default on VPC creation +* `defaultSecurityGroupId` - The ID of the security group created by default on VPC creation +* `defaultRouteTableId` - The ID of the route table created by default on VPC creation +* `ipv6AssociationId` - The association ID for the IPv6 CIDR block. +* `ipv6CidrBlockNetworkBorderGroup` - The Network Border Group Zone name +* `ownerId` - The ID of the AWS account that owns the VPC. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +VPCs can be imported using the `vpc id`, e.g., + +``` +$ terraform import aws_vpc.test_vpc vpc-a01106c2 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_dhcp_options.html.markdown b/website/docs/cdktf/typescript/r/vpc_dhcp_options.html.markdown new file mode 100644 index 00000000000..43804994a86 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_dhcp_options.html.markdown @@ -0,0 +1,107 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_dhcp_options" +description: |- + Provides a VPC DHCP Options resource. +--- + + + +# Resource: aws_vpc_dhcp_options + +Provides a VPC DHCP Options resource. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcDhcpOptions } from "./.gen/providers/aws/vpc-dhcp-options"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcDhcpOptions(this, "dns_resolver", { + domainNameServers: ["8.8.8.8", "8.8.4.4"], + }); + } +} + +``` + +Full usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcDhcpOptions } from "./.gen/providers/aws/vpc-dhcp-options"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcDhcpOptions(this, "foo", { + domainName: "service.consul", + domainNameServers: ["127.0.0.1", "10.0.0.2"], + netbiosNameServers: ["127.0.0.1"], + netbiosNodeType: Token.asString(2), + ntpServers: ["127.0.0.1"], + tags: { + Name: "foo-name", + }, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `domainName` - (Optional) the suffix domain name to use by default when resolving non Fully Qualified Domain Names. In other words, this is what ends up being the `search` value in the `/etc/resolvConf` file. +* `domainNameServers` - (Optional) List of name servers to configure in `/etc/resolvConf`. If you want to use the default AWS nameservers you should set this to `amazonProvidedDns`. +* `ntpServers` - (Optional) List of NTP servers to configure. +* `netbiosNameServers` - (Optional) List of NETBIOS name servers. +* `netbiosNodeType` - (Optional) The NetBIOS node type (1, 2, 4, or 8). AWS recommends to specify 2 since broadcast and multicast are not supported in their network. For more information about these node types, see [RFC 2132](http://www.ietf.org/rfc/rfc2132.txt). +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Remarks + +* Notice that all arguments are optional but you have to specify at least one argument. +* `domainNameServers`, `netbiosNameServers`, `ntpServers` are limited by AWS to maximum four servers only. +* To actually use the DHCP Options Set you need to associate it to a VPC using [`awsVpcDhcpOptionsAssociation`](/docs/providers/aws/r/vpc_dhcp_options_association.html). +* If you delete a DHCP Options Set, all VPCs using it will be associated to AWS's `default` DHCP Option Set. +* In most cases unless you're configuring your own DNS you'll want to set `domainNameServers` to `amazonProvidedDns`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the DHCP Options Set. +* `arn` - The ARN of the DHCP Options Set. +* `ownerId` - The ID of the AWS account that owns the DHCP options set. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +You can find more technical documentation about DHCP Options Set in the +official [AWS User Guide](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html). + +## Import + +VPC DHCP Options can be imported using the `dhcp options id`, e.g., + +``` +$ terraform import aws_vpc_dhcp_options.my_options dopt-d9070ebb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_dhcp_options_association.html.markdown b/website/docs/cdktf/typescript/r/vpc_dhcp_options_association.html.markdown new file mode 100644 index 00000000000..defd0a78288 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_dhcp_options_association.html.markdown @@ -0,0 +1,64 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_dhcp_options_association" +description: |- + Provides a VPC DHCP Options Association resource. +--- + + + +# Resource: aws_vpc_dhcp_options_association + +Provides a VPC DHCP Options Association resource. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcDhcpOptionsAssociation } from "./.gen/providers/aws/vpc-dhcp-options-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcDhcpOptionsAssociation(this, "dns_resolver", { + dhcpOptionsId: foo.id, + vpcId: Token.asString(awsVpcFoo.id), + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `vpcId` - (Required) The ID of the VPC to which we would like to associate a DHCP Options Set. +* `dhcpOptionsId` - (Required) The ID of the DHCP Options Set to associate to the VPC. + +## Remarks + +* You can only associate one DHCP Options Set to a given VPC ID. +* Removing the DHCP Options Association automatically sets AWS's `default` DHCP Options Set to the VPC. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the DHCP Options Set Association. + +## Import + +DHCP associations can be imported by providing the VPC ID associated with the options: + +``` +$ terraform import aws_vpc_dhcp_options_association.imported vpc-0f001273ec18911b1 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint.html.markdown new file mode 100644 index 00000000000..707696a4378 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint.html.markdown @@ -0,0 +1,248 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint" +description: |- + Provides a VPC Endpoint resource. +--- + + + +# Resource: aws_vpc_endpoint + +Provides a VPC Endpoint resource. + +~> **NOTE on VPC Endpoints and VPC Endpoint Associations:** Terraform provides both standalone VPC Endpoint Associations for +[Route Tables](vpc_endpoint_route_table_association.html) - (an association between a VPC endpoint and a single `routeTableId`), +[Security Groups](vpc_endpoint_security_group_association.html) - (an association between a VPC endpoint and a single `securityGroupId`), +and [Subnets](vpc_endpoint_subnet_association.html) - (an association between a VPC endpoint and a single `subnetId`) and +a VPC Endpoint resource with `routeTableIds` and `subnetIds` attributes. +Do not use the same resource ID in both a VPC Endpoint resource and a VPC Endpoint Association resource. +Doing so will cause a conflict of associations and will overwrite the association. + +## Example Usage + +### Basic + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpoint } from "./.gen/providers/aws/vpc-endpoint"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcEndpoint(this, "s3", { + serviceName: "com.amazonaws.us-west-2.s3", + vpcId: main.id, + }); + } +} + +``` + +### Basic w/ Tags + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpoint } from "./.gen/providers/aws/vpc-endpoint"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcEndpoint(this, "s3", { + serviceName: "com.amazonaws.us-west-2.s3", + tags: { + Environment: "test", + }, + vpcId: main.id, + }); + } +} + +``` + +### Interface Endpoint Type + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpoint } from "./.gen/providers/aws/vpc-endpoint"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcEndpoint(this, "ec2", { + privateDnsEnabled: true, + securityGroupIds: [sg1.id], + serviceName: "com.amazonaws.us-west-2.ec2", + vpcEndpointType: "Interface", + vpcId: main.id, + }); + } +} + +``` + +### Gateway Load Balancer Endpoint Type + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsCallerIdentity } from "./.gen/providers/aws/data-aws-caller-identity"; +import { VpcEndpoint } from "./.gen/providers/aws/vpc-endpoint"; +import { VpcEndpointService } from "./.gen/providers/aws/vpc-endpoint-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsCallerIdentity(this, "current", {}); + const example = new VpcEndpointService(this, "example", { + acceptanceRequired: false, + allowedPrincipals: [Token.asString(current.arn)], + gatewayLoadBalancerArns: [Token.asString(awsLbExample.arn)], + }); + const awsVpcEndpointExample = new VpcEndpoint(this, "example_2", { + serviceName: example.serviceName, + subnetIds: [Token.asString(awsSubnetExample.id)], + vpcEndpointType: example.serviceType, + vpcId: Token.asString(awsVpcExample.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcEndpointExample.overrideLogicalId("example"); + } +} + +``` + +### Non-AWS Service + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, propertyAccess, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRoute53Zone } from "./.gen/providers/aws/data-aws-route53-zone"; +import { Route53Record } from "./.gen/providers/aws/route53-record"; +import { VpcEndpoint } from "./.gen/providers/aws/vpc-endpoint"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const ptfeService = new VpcEndpoint(this, "ptfe_service", { + privateDnsEnabled: false, + securityGroupIds: [Token.asString(awsSecurityGroupPtfeService.id)], + serviceName: Token.asString(varPtfeService.value), + subnetIds: [subnetIds], + vpcEndpointType: "Interface", + vpcId: vpcId.stringValue, + }); + const internal = new DataAwsRoute53Zone(this, "internal", { + name: "vpc.internal.", + privateZone: true, + vpcId: vpcId.stringValue, + }); + const awsRoute53RecordPtfeService = new Route53Record( + this, + "ptfe_service_2", + { + name: "ptfe.${" + internal.name + "}", + records: [ + Token.asString( + propertyAccess(ptfeService.dnsEntry, ["0", '"dns_name"']) + ), + ], + ttl: Token.asNumber("300"), + type: "CNAME", + zoneId: Token.asString(internal.zoneId), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsRoute53RecordPtfeService.overrideLogicalId("ptfe_service"); + } +} + +``` + +~> **NOTE The `dnsEntry` output is a list of maps:** Terraform interpolation support for lists of maps requires the `lookup` and `[]` until full support of lists of maps is available + +## Argument Reference + +The following arguments are supported: + +* `serviceName` - (Required) The service name. For AWS services the service name is usually in the form `comAmazonaws..` (the SageMaker Notebook service is an exception to this rule, the service name is in the form `awsSagemaker.Notebook`). +* `vpcId` - (Required) The ID of the VPC in which the endpoint will be used. +* `autoAccept` - (Optional) Accept the VPC endpoint (the VPC endpoint and service need to be in the same AWS account). +* `policy` - (Optional) A policy to attach to the endpoint that controls access to the service. This is a JSON formatted string. Defaults to full access. All `gateway` and some `interface` endpoints support policies - see the [relevant AWS documentation](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) for more details. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). +* `privateDnsEnabled` - (Optional; AWS services and AWS Marketplace partner services only) Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type `interface`. +Defaults to `false`. +* `dnsOptions` - (Optional) The DNS options for the endpoint. See dns_options below. +* `ipAddressType` - (Optional) The IP address type for the endpoint. Valid values are `ipv4`, `dualstack`, and `ipv6`. +* `routeTableIds` - (Optional) One or more route table IDs. Applicable for endpoints of type `gateway`. +* `subnetIds` - (Optional) The ID of one or more subnets in which to create a network interface for the endpoint. Applicable for endpoints of type `gatewayLoadBalancer` and `interface`. +* `securityGroupIds` - (Optional) The ID of one or more security groups to associate with the network interface. Applicable for endpoints of type `interface`. +If no security groups are specified, the VPC's [default security group](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#DefaultSecurityGroup) is associated with the endpoint. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `vpcEndpointType` - (Optional) The VPC endpoint type, `gateway`, `gatewayLoadBalancer`, or `interface`. Defaults to `gateway`. + +### dns_options + +* `dnsRecordIpType` - (Optional) The DNS records created for the endpoint. Valid values are `ipv4`, `dualstack`, `serviceDefined`, and `ipv6`. +* `privateDnsOnlyForInboundResolverEndpoint` - (Optional) Indicates whether to enable private DNS only for inbound endpoints. This option is available only for services that support both gateway and interface endpoints. It routes traffic that originates from the VPC to the gateway endpoint and traffic that originates from on-premises to the interface endpoint. Can only be specified if `privateDnsEnabled` is `true`. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `10M`) +- `update` - (Default `10M`) +- `delete` - (Default `10M`) + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC endpoint. +* `arn` - The Amazon Resource Name (ARN) of the VPC endpoint. +* `cidrBlocks` - The list of CIDR blocks for the exposed AWS service. Applicable for endpoints of type `gateway`. +* `dnsEntry` - The DNS entries for the VPC Endpoint. Applicable for endpoints of type `interface`. DNS blocks are documented below. +* `networkInterfaceIds` - One or more network interfaces for the VPC Endpoint. Applicable for endpoints of type `interface`. +* `ownerId` - The ID of the AWS account that owns the VPC endpoint. +* `prefixListId` - The prefix list ID of the exposed AWS service. Applicable for endpoints of type `gateway`. +* `requesterManaged` - Whether or not the VPC Endpoint is being managed by its service - `true` or `false`. +* `state` - The state of the VPC endpoint. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +DNS blocks (for `dnsEntry`) support the following attributes: + +* `dnsName` - The DNS name. +* `hostedZoneId` - The ID of the private hosted zone. + +## Import + +VPC Endpoints can be imported using the `vpc endpoint id`, e.g., + +``` +$ terraform import aws_vpc_endpoint.endpoint1 vpce-3ecf2a57 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint_connection_accepter.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint_connection_accepter.html.markdown new file mode 100644 index 00000000000..279583eeeb2 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint_connection_accepter.html.markdown @@ -0,0 +1,85 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_connection_accepter" +description: |- + Provides a resource to accept a pending VPC Endpoint accept request to VPC Endpoint Service. +--- + + + +# Resource: aws_vpc_endpoint_connection_accepter + +Provides a resource to accept a pending VPC Endpoint Connection accept request to VPC Endpoint Service. + +## Example Usage + +### Accept cross-account request + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpoint } from "./.gen/providers/aws/vpc-endpoint"; +import { VpcEndpointConnectionAccepter } from "./.gen/providers/aws/vpc-endpoint-connection-accepter"; +import { VpcEndpointService } from "./.gen/providers/aws/vpc-endpoint-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new VpcEndpoint(this, "example", { + privateDnsEnabled: false, + provider: alternate, + securityGroupIds: [test.id], + serviceName: Token.asString(awsVpcEndpointServiceTest.serviceName), + vpcEndpointType: "Interface", + vpcId: testAlternate.id, + }); + const awsVpcEndpointServiceExample = new VpcEndpointService( + this, + "example_1", + { + acceptanceRequired: false, + networkLoadBalancerArns: [Token.asString(awsLbExample.arn)], + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcEndpointServiceExample.overrideLogicalId("example"); + const awsVpcEndpointConnectionAccepterExample = + new VpcEndpointConnectionAccepter(this, "example_2", { + vpcEndpointId: example.id, + vpcEndpointServiceId: Token.asString(awsVpcEndpointServiceExample.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcEndpointConnectionAccepterExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `vpcEndpointId` - (Required) AWS VPC Endpoint ID. +* `vpcEndpointServiceId` - (Required) AWS VPC Endpoint Service ID. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC Endpoint Connection. +* `vpcEndpointState` - State of the VPC Endpoint. + +## Import + +VPC Endpoint Services can be imported using ID of the connection, which is the `VPC Endpoint Service ID` and `VPC Endpoint ID` separated by underscore (`_`). e.g. + +``` +$ terraform import aws_vpc_endpoint_connection_accepter.foo vpce-svc-0f97a19d3fa8220bc_vpce-010601a6db371e263 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint_connection_notification.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint_connection_notification.html.markdown new file mode 100644 index 00000000000..14c549d4c13 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint_connection_notification.html.markdown @@ -0,0 +1,98 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_connection_notification" +description: |- + Provides a VPC Endpoint connection notification resource. +--- + + + +# Resource: aws_vpc_endpoint_connection_notification + +Provides a VPC Endpoint connection notification resource. +Connection notifications notify subscribers of VPC Endpoint events. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsIamPolicyDocument } from "./.gen/providers/aws/data-aws-iam-policy-document"; +import { SnsTopic } from "./.gen/providers/aws/sns-topic"; +import { VpcEndpointConnectionNotification } from "./.gen/providers/aws/vpc-endpoint-connection-notification"; +import { VpcEndpointService } from "./.gen/providers/aws/vpc-endpoint-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const foo = new VpcEndpointService(this, "foo", { + acceptanceRequired: false, + networkLoadBalancerArns: [test.arn], + }); + const topic = new DataAwsIamPolicyDocument(this, "topic", { + statement: [ + { + actions: ["SNS:Publish"], + effect: "Allow", + principals: [ + { + identifiers: ["vpce.amazonaws.com"], + type: "Service", + }, + ], + resources: ["arn:aws:sns:*:*:vpce-notification-topic"], + }, + ], + }); + const awsSnsTopicTopic = new SnsTopic(this, "topic_2", { + name: "vpce-notification-topic", + policy: Token.asString(topic.json), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsSnsTopicTopic.overrideLogicalId("topic"); + const awsVpcEndpointConnectionNotificationFoo = + new VpcEndpointConnectionNotification(this, "foo_3", { + connectionEvents: ["Accept", "Reject"], + connectionNotificationArn: Token.asString(awsSnsTopicTopic.arn), + vpcEndpointServiceId: foo.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcEndpointConnectionNotificationFoo.overrideLogicalId("foo"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `vpcEndpointServiceId` - (Optional) The ID of the VPC Endpoint Service to receive notifications for. +* `vpcEndpointId` - (Optional) The ID of the VPC Endpoint to receive notifications for. +* `connectionNotificationArn` - (Required) The ARN of the SNS topic for the notifications. +* `connectionEvents` - (Required) One or more endpoint [events](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVpcEndpointConnectionNotification.html#API_CreateVpcEndpointConnectionNotification_RequestParameters) for which to receive notifications. + +~> **NOTE:** One of `vpcEndpointServiceId` or `vpcEndpointId` must be specified. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC connection notification. +* `state` - The state of the notification. +* `notificationType` - The type of notification. + +## Import + +VPC Endpoint connection notifications can be imported using the `VPC endpoint connection notification id`, e.g., + +``` +$ terraform import aws_vpc_endpoint_connection_notification.foo vpce-nfn-09e6ed3b4efba2263 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint_policy.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint_policy.html.markdown new file mode 100644 index 00000000000..177057718f4 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint_policy.html.markdown @@ -0,0 +1,101 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_policy" +description: |- + Provides a VPC Endpoint Policy resource. +--- + + + +# Resource: aws_vpc_endpoint_policy + +Provides a VPC Endpoint Policy resource. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, Fn, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsVpcEndpointService } from "./.gen/providers/aws/data-aws-vpc-endpoint-service"; +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcEndpoint } from "./.gen/providers/aws/vpc-endpoint"; +import { VpcEndpointPolicy } from "./.gen/providers/aws/vpc-endpoint-policy"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new Vpc(this, "example", { + cidrBlock: "10.0.0.0/16", + }); + const dataAwsVpcEndpointServiceExample = new DataAwsVpcEndpointService( + this, + "example_1", + { + service: "dynamodb", + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataAwsVpcEndpointServiceExample.overrideLogicalId("example"); + const awsVpcEndpointExample = new VpcEndpoint(this, "example_2", { + serviceName: Token.asString(dataAwsVpcEndpointServiceExample.serviceName), + vpcId: example.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcEndpointExample.overrideLogicalId("example"); + const awsVpcEndpointPolicyExample = new VpcEndpointPolicy( + this, + "example_3", + { + policy: Token.asString( + Fn.jsonencode({ + Statement: [ + { + Action: ["dynamodb:*"], + Effect: "Allow", + Principal: { + AWS: "*", + }, + Resource: "*", + Sid: "AllowAll", + }, + ], + Version: "2012-10-17", + }) + ), + vpcEndpointId: Token.asString(awsVpcEndpointExample.id), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcEndpointPolicyExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `vpcEndpointId` - (Required) The VPC Endpoint ID. +* `policy` - (Optional) A policy to attach to the endpoint that controls access to the service. Defaults to full access. All `gateway` and some `interface` endpoints support policies - see the [relevant AWS documentation](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) for more details. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC endpoint. + +## Import + +VPC Endpoint Policies can be imported using the `id`, e.g. + +``` +$ terraform import aws_vpc_endpoint_policy.example vpce-3ecf2a57 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint_route_table_association.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint_route_table_association.html.markdown new file mode 100644 index 00000000000..76944cb042e --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint_route_table_association.html.markdown @@ -0,0 +1,60 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_route_table_association" +description: |- + Manages a VPC Endpoint Route Table Association +--- + + + +# Resource: aws_vpc_endpoint_route_table_association + +Manages a VPC Endpoint Route Table Association + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpointRouteTableAssociation } from "./.gen/providers/aws/vpc-endpoint-route-table-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcEndpointRouteTableAssociation(this, "example", { + routeTableId: Token.asString(awsRouteTableExample.id), + vpcEndpointId: Token.asString(awsVpcEndpointExample.id), + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `routeTableId` - (Required) Identifier of the EC2 Route Table to be associated with the VPC Endpoint. +* `vpcEndpointId` - (Required) Identifier of the VPC Endpoint with which the EC2 Route Table will be associated. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - A hash of the EC2 Route Table and VPC Endpoint identifiers. + +## Import + +VPC Endpoint Route Table Associations can be imported using `vpcEndpointId` together with `routeTableId`, +e.g., + +``` +$ terraform import aws_vpc_endpoint_route_table_association.example vpce-aaaaaaaa/rtb-bbbbbbbb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint_security_group_association.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint_security_group_association.html.markdown new file mode 100644 index 00000000000..defb3504a6b --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint_security_group_association.html.markdown @@ -0,0 +1,60 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_security_group_association" +description: |- + Provides a resource to create an association between a VPC endpoint and a security group. +--- + + + +# Resource: aws_vpc_endpoint_security_group_association + +Provides a resource to create an association between a VPC endpoint and a security group. + +~> **NOTE on VPC Endpoints and VPC Endpoint Security Group Associations:** Terraform provides +both a standalone VPC Endpoint Security Group Association (an association between a VPC endpoint +and a single `securityGroupId`) and a [VPC Endpoint](vpc_endpoint.html) resource with a `securityGroupIds` +attribute. Do not use the same security group ID in both a VPC Endpoint resource and a VPC Endpoint Security +Group Association resource. Doing so will cause a conflict of associations and will overwrite the association. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpointSecurityGroupAssociation } from "./.gen/providers/aws/vpc-endpoint-security-group-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcEndpointSecurityGroupAssociation(this, "sg_ec2", { + securityGroupId: sg.id, + vpcEndpointId: ec2.id, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `securityGroupId` - (Required) The ID of the security group to be associated with the VPC endpoint. +* `vpcEndpointId` - (Required) The ID of the VPC endpoint with which the security group will be associated. +* `replaceDefaultAssociation` - (Optional) Whether this association should replace the association with the VPC's default security group that is created when no security groups are specified during VPC endpoint creation. At most 1 association per-VPC endpoint should be configured with `replace_default_association = true`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the association. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint_service.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint_service.html.markdown new file mode 100644 index 00000000000..00c751fc778 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint_service.html.markdown @@ -0,0 +1,109 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_service" +description: |- + Provides a VPC Endpoint Service resource. +--- + + + +# Resource: aws_vpc_endpoint_service + +Provides a VPC Endpoint Service resource. +Service consumers can create an _Interface_ [VPC Endpoint](vpc_endpoint.html) to connect to the service. + +~> **NOTE on VPC Endpoint Services and VPC Endpoint Service Allowed Principals:** Terraform provides +both a standalone [VPC Endpoint Service Allowed Principal](vpc_endpoint_service_allowed_principal.html) resource +and a VPC Endpoint Service resource with an `allowedPrincipals` attribute. Do not use the same principal ARN in both +a VPC Endpoint Service resource and a VPC Endpoint Service Allowed Principal resource. Doing so will cause a conflict +and will overwrite the association. + +## Example Usage + +### Network Load Balancers + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpointService } from "./.gen/providers/aws/vpc-endpoint-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcEndpointService(this, "example", { + acceptanceRequired: false, + networkLoadBalancerArns: [Token.asString(awsLbExample.arn)], + }); + } +} + +``` + +### Gateway Load Balancers + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpointService } from "./.gen/providers/aws/vpc-endpoint-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcEndpointService(this, "example", { + acceptanceRequired: false, + gatewayLoadBalancerArns: [Token.asString(awsLbExample.arn)], + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `acceptanceRequired` - (Required) Whether or not VPC endpoint connection requests to the service must be accepted by the service owner - `true` or `false`. +* `allowedPrincipals` - (Optional) The ARNs of one or more principals allowed to discover the endpoint service. +* `gatewayLoadBalancerArns` - (Optional) Amazon Resource Names (ARNs) of one or more Gateway Load Balancers for the endpoint service. +* `networkLoadBalancerArns` - (Optional) Amazon Resource Names (ARNs) of one or more Network Load Balancers for the endpoint service. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `privateDnsName` - (Optional) The private DNS name for the service. +* `supportedIpAddressTypes` - (Optional) The supported IP address types. The possible values are `ipv4` and `ipv6`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC endpoint service. +* `availabilityZones` - A set of Availability Zones in which the service is available. +* `arn` - The Amazon Resource Name (ARN) of the VPC endpoint service. +* `baseEndpointDnsNames` - A set of DNS names for the service. +* `managesVpcEndpoints` - Whether or not the service manages its VPC endpoints - `true` or `false`. +* `serviceName` - The service name. +* `serviceType` - The service type, `gateway` or `interface`. +* `state` - The state of the VPC endpoint service. +* `privateDnsNameConfiguration` - List of objects containing information about the endpoint service private DNS name configuration. + * `name` - Name of the record subdomain the service provider needs to create. + * `state` - Verification state of the VPC endpoint service. Consumers of the endpoint service can use the private name only when the state is `verified`. + * `type` - Endpoint service verification type, for example `txt`. + * `value` - Value the service provider adds to the private DNS name domain record before verification. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +VPC Endpoint Services can be imported using the `VPC endpoint service id`, e.g., + +``` +$ terraform import aws_vpc_endpoint_service.foo vpce-svc-0f97a19d3fa8220bc +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint_service_allowed_principal.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint_service_allowed_principal.html.markdown new file mode 100644 index 00000000000..273a826159f --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint_service_allowed_principal.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_service_allowed_principal" +description: |- + Provides a resource to allow a principal to discover a VPC endpoint service. +--- + + + +# Resource: aws_vpc_endpoint_service_allowed_principal + +Provides a resource to allow a principal to discover a VPC endpoint service. + +~> **NOTE on VPC Endpoint Services and VPC Endpoint Service Allowed Principals:** Terraform provides +both a standalone [VPC Endpoint Service Allowed Principal](vpc_endpoint_service_allowed_principal.html) resource +and a VPC Endpoint Service resource with an `allowedPrincipals` attribute. Do not use the same principal ARN in both +a VPC Endpoint Service resource and a VPC Endpoint Service Allowed Principal resource. Doing so will cause a conflict +and will overwrite the association. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsCallerIdentity } from "./.gen/providers/aws/data-aws-caller-identity"; +import { VpcEndpointServiceAllowedPrincipal } from "./.gen/providers/aws/vpc-endpoint-service-allowed-principal"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsCallerIdentity(this, "current", {}); + new VpcEndpointServiceAllowedPrincipal(this, "allow_me_to_foo", { + principalArn: Token.asString(current.arn), + vpcEndpointServiceId: foo.id, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `vpcEndpointServiceId` - (Required) The ID of the VPC endpoint service to allow permission. +* `principalArn` - (Required) The ARN of the principal to allow permissions. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the association. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_endpoint_subnet_association.html.markdown b/website/docs/cdktf/typescript/r/vpc_endpoint_subnet_association.html.markdown new file mode 100644 index 00000000000..0e257718823 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_endpoint_subnet_association.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_endpoint_subnet_association" +description: |- + Provides a resource to create an association between a VPC endpoint and a subnet. +--- + + + +# Resource: aws_vpc_endpoint_subnet_association + +Provides a resource to create an association between a VPC endpoint and a subnet. + +~> **NOTE on VPC Endpoints and VPC Endpoint Subnet Associations:** Terraform provides +both a standalone VPC Endpoint Subnet Association (an association between a VPC endpoint +and a single `subnetId`) and a [VPC Endpoint](vpc_endpoint.html) resource with a `subnetIds` +attribute. Do not use the same subnet ID in both a VPC Endpoint resource and a VPC Endpoint Subnet +Association resource. Doing so will cause a conflict of associations and will overwrite the association. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcEndpointSubnetAssociation } from "./.gen/providers/aws/vpc-endpoint-subnet-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcEndpointSubnetAssociation(this, "sn_ec2", { + subnetId: sn.id, + vpcEndpointId: ec2.id, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `vpcEndpointId` - (Required) The ID of the VPC endpoint with which the subnet will be associated. +* `subnetId` - (Required) The ID of the subnet to be associated with the VPC endpoint. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the association. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `10M`) +- `delete` - (Default `10M`) + +## Import + +VPC Endpoint Subnet Associations can be imported using `vpcEndpointId` together with `subnetId`, +e.g., + +``` +$ terraform import aws_vpc_endpoint_subnet_association.example vpce-aaaaaaaa/subnet-bbbbbbbbbbbbbbbbb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam.html.markdown new file mode 100644 index 00000000000..eb4047baccb --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam.html.markdown @@ -0,0 +1,134 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam" +description: |- + Provides an IPAM resource. +--- + + + +# Resource: aws_vpc_ipam + +Provides an IPAM resource. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + new VpcIpam(this, "main", { + description: "My IPAM", + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + tags: { + Test: "Main", + }, + }); + } +} + +``` + +Shared with multiple operating_regions: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { + VariableType, + TerraformVariable, + Fn, + Token, + TerraformIterator, + TerraformStack, +} from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + /*Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK. + You can read more about this at https://cdk.tf/variables*/ + const ipamRegions = new TerraformVariable(this, "ipam_regions", { + default: ["us-east-1", "us-west-2"], + type: VariableType.ANY, + }); + const current = new DataAwsRegion(this, "current", {}); + const allIpamRegions = Fn.distinct( + Token.asAny(Fn.concat([[current.name], ipamRegions.value])) + ); + /*In most cases loops should be handled in the programming language context and + not inside of the Terraform context. If you are looping over something external, e.g. a variable or a file input + you should consider using a for loop. If you are looping over something only known to Terraform, e.g. a result of a data source + you need to keep this like it is.*/ + const mainDynamicIterator0 = TerraformIterator.fromList( + Token.asAny(allIpamRegions) + ); + new VpcIpam(this, "main", { + description: "multi region ipam", + operatingRegions: mainDynamicIterator0.dynamic({ + region_name: mainDynamicIterator0.value, + }), + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `description` - (Optional) A description for the IPAM. +* `operatingRegions` - (Required) Determines which locales can be chosen when you create pools. Locale is the Region where you want to make an IPAM pool available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. You specify a region using the [region_name](#operating_regions) parameter. You **must** set your provider block region as an operating_region. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `cascade` - (Optional) Enables you to quickly delete an IPAM, private scopes, pools in private scopes, and any allocations in the pools in private scopes. + +### operating_regions + +* `regionName` - (Required) The name of the Region you want to add to the IPAM. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of IPAM +* `id` - The ID of the IPAM +* `defaultResourceDiscoveryId` - The IPAM's default resource discovery ID. +* `defaultResourceDiscoveryAssociationId` - The IPAM's default resource discovery association ID. +* `privateDefaultScopeId` - The ID of the IPAM's private scope. A scope is a top-level container in IPAM. Each scope represents an IP-independent network. Scopes enable you to represent networks where you have overlapping IP space. When you create an IPAM, IPAM automatically creates two scopes: public and private. The private scope is intended for private IP space. The public scope is intended for all internet-routable IP space. +* `publicDefaultScopeId` - The ID of the IPAM's public scope. A scope is a top-level container in IPAM. Each scope represents an IP-independent network. Scopes enable you to represent networks where you have overlapping IP space. When you create an IPAM, IPAM automatically creates two scopes: public and private. The private scope is intended for private +IP space. The public scope is intended for all internet-routable IP space. +* `scopeCount` - The number of scopes in the IPAM. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +IPAMs can be imported using the `ipam id`, e.g. + +``` +$ terraform import aws_vpc_ipam.example ipam-0178368ad2146a492 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam_organization_admin_account.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam_organization_admin_account.html.markdown new file mode 100644 index 00000000000..15c33e50490 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam_organization_admin_account.html.markdown @@ -0,0 +1,71 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_organization_admin_account" +description: |- + Enables the IPAM Service and promotes an account to delegated administrator for the service. +--- + + + +# Resource: aws_vpc_ipam_organization_admin_account + +Enables the IPAM Service and promotes a delegated administrator. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsCallerIdentity } from "./.gen/providers/aws/data-aws-caller-identity"; +import { AwsProvider } from "./.gen/providers/aws/provider"; +import { VpcIpamOrganizationAdminAccount } from "./.gen/providers/aws/vpc-ipam-organization-admin-account"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const ipamDelegateAccount = new AwsProvider(this, "aws", { + alias: "ipam_delegate_account", + }); + const delegated = new DataAwsCallerIdentity(this, "delegated", { + provider: ipamDelegateAccount, + }); + new VpcIpamOrganizationAdminAccount(this, "example", { + delegatedAdminAccountId: Token.asString(delegated.accountId), + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `delegatedAdminAccountId` - (Required) + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Organizations ARN for the delegate account. +* `id` - The Organizations member account ID that you want to enable as the IPAM account. +* `email` - The Organizations email for the delegate account. +* `name` - The Organizations name for the delegate account. +* `servicePrincipal` - The AWS service principal. + +## Import + +IPAMs can be imported using the `delegate account id`, e.g. + +``` +$ terraform import aws_vpc_ipam_organization_admin_account.example 12345678901 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam_pool.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam_pool.html.markdown new file mode 100644 index 00000000000..95ff2e4690a --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam_pool.html.markdown @@ -0,0 +1,138 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool" +description: |- + Provides a IP address pool resource for IPAM. +--- + + + +# Resource: aws_vpc_ipam_pool + +Provides an IP address pool resource for IPAM. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamPool } from "./.gen/providers/aws/vpc-ipam-pool"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const example = new VpcIpam(this, "example", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const awsVpcIpamPoolExample = new VpcIpamPool(this, "example_2", { + addressFamily: "ipv4", + ipamScopeId: example.privateDefaultScopeId, + locale: Token.asString(current.name), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolExample.overrideLogicalId("example"); + } +} + +``` + +Nested Pools: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamPool } from "./.gen/providers/aws/vpc-ipam-pool"; +import { VpcIpamPoolCidr } from "./.gen/providers/aws/vpc-ipam-pool-cidr"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const example = new VpcIpam(this, "example", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const parent = new VpcIpamPool(this, "parent", { + addressFamily: "ipv4", + ipamScopeId: example.privateDefaultScopeId, + }); + new VpcIpamPoolCidr(this, "parent_test", { + cidr: "172.2.0.0/16", + ipamPoolId: parent.id, + }); + const child = new VpcIpamPool(this, "child", { + addressFamily: "ipv4", + ipamScopeId: example.privateDefaultScopeId, + locale: Token.asString(current.name), + sourceIpamPoolId: parent.id, + }); + new VpcIpamPoolCidr(this, "child_test", { + cidr: "172.2.0.0/24", + ipamPoolId: child.id, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `addressFamily` - (Optional) The IP protocol assigned to this pool. You must choose either IPv4 or IPv6 protocol for a pool. +* `allocationDefaultNetmaskLength` - (Optional) A default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16 (unless you provide a different netmask value when you create the new allocation). +* `allocationMaxNetmaskLength` - (Optional) The maximum netmask length that will be required for CIDR allocations in this pool. +* `allocationMinNetmaskLength` - (Optional) The minimum netmask length that will be required for CIDR allocations in this pool. +* `allocationResourceTags` - (Optional) Tags that are required for resources that use CIDRs from this IPAM pool. Resources that do not have these tags will not be allowed to allocate space from the pool. If the resources have their tags changed after they have allocated space or if the allocation tagging requirements are changed on the pool, the resource may be marked as noncompliant. +* `autoImport` - (Optional) If you include this argument, IPAM automatically imports any VPCs you have in your scope that fall +within the CIDR range in the pool. +* `awsService` - (Optional) Limits which AWS service the pool can be used in. Only useable on public scopes. Valid Values: `ec2`. +* `description` - (Optional) A description for the IPAM pool. +* `ipamScopeId` - (Optional) The ID of the scope in which you would like to create the IPAM pool. +* `locale` - (Optional) The locale in which you would like to create the IPAM pool. Locale is the Region where you want to make an IPAM pool available for allocations. You can only create pools with locales that match the operating Regions of the IPAM. You can only create VPCs from a pool whose locale matches the VPC's Region. Possible values: Any AWS region, such as `usEast1`. +* `publiclyAdvertisable` - (Optional) Defines whether or not IPv6 pool space is publicly advertisable over the internet. This argument is required if `address_family = "ipv6"` and `public_ip_source = "byoip"`, default is `false`. This option is not available for IPv4 pool space or if `public_ip_source = "amazon"`. +* `publicIpSource` - (Optional) The IP address source for pools in the public scope. Only used for provisioning IP address CIDRs to pools in the public scope. Valid values are `byoip` or `amazon`. Default is `byoip`. +* `sourceIpamPoolId` - (Optional) The ID of the source IPAM pool. Use this argument to create a child pool within an existing pool. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of IPAM +* `id` - The ID of the IPAM +* `state` - The ID of the IPAM +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +IPAMs can be imported using the `ipam pool id`, e.g. + +``` +$ terraform import aws_vpc_ipam_pool.example ipam-pool-0958f95207d978e1e +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam_pool_cidr.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam_pool_cidr.html.markdown new file mode 100644 index 00000000000..07f4d9758ba --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam_pool_cidr.html.markdown @@ -0,0 +1,146 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool_cidr" +description: |- + Provisions a CIDR from an IPAM address pool. +--- + + + +# Resource: aws_vpc_ipam_pool_cidr + +Provisions a CIDR from an IPAM address pool. + +~> **NOTE:** Provisioning Public IPv4 or Public IPv6 require [steps outside the scope of this resource](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip). The resource accepts `message` and `signature` as part of the `cidrAuthorizationContext` attribute but those must be generated ahead of time. Public IPv6 CIDRs that are provisioned into a Pool with `publicly_advertisable = true` and all public IPv4 CIDRs also require creating a Route Origin Authorization (ROA) object in your Regional Internet Registry (RIR). + +~> **NOTE:** In order to deprovision CIDRs all Allocations must be released. Allocations created by a VPC take up to 30 minutes to be released. However, for IPAM to properly manage the removal of allocation records created by VPCs and other resources, you must [grant it permissions](https://docs.aws.amazon.com/vpc/latest/ipam/choose-single-user-or-orgs-ipam.html) in +either a single account or organizationally. If you are unable to deprovision a cidr after waiting over 30 minutes, you may be missing the Service Linked Role. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamPool } from "./.gen/providers/aws/vpc-ipam-pool"; +import { VpcIpamPoolCidr } from "./.gen/providers/aws/vpc-ipam-pool-cidr"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const example = new VpcIpam(this, "example", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const awsVpcIpamPoolExample = new VpcIpamPool(this, "example_2", { + addressFamily: "ipv4", + ipamScopeId: example.privateDefaultScopeId, + locale: Token.asString(current.name), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolExample.overrideLogicalId("example"); + const awsVpcIpamPoolCidrExample = new VpcIpamPoolCidr(this, "example_3", { + cidr: "172.2.0.0/16", + ipamPoolId: Token.asString(awsVpcIpamPoolExample.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrExample.overrideLogicalId("example"); + } +} + +``` + +Provision Public IPv6 Pool CIDRs: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamPool } from "./.gen/providers/aws/vpc-ipam-pool"; +import { VpcIpamPoolCidr } from "./.gen/providers/aws/vpc-ipam-pool-cidr"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const example = new VpcIpam(this, "example", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const ipv6TestPublic = new VpcIpamPool(this, "ipv6_test_public", { + addressFamily: "ipv6", + advertisable: false, + awsService: "ec2", + description: "public ipv6", + ipamScopeId: example.publicDefaultScopeId, + locale: "us-east-1", + }); + const awsVpcIpamPoolCidrIpv6TestPublic = new VpcIpamPoolCidr( + this, + "ipv6_test_public_3", + { + cidr: ipv6Cidr.stringValue, + cidrAuthorizationContext: { + message: message.stringValue, + signature: signature.stringValue, + }, + ipamPoolId: ipv6TestPublic.id, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrIpv6TestPublic.overrideLogicalId("ipv6_test_public"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `cidr` - (Optional) The CIDR you want to assign to the pool. Conflicts with `netmaskLength`. +* `cidrAuthorizationContext` - (Optional) A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP. This is not stored in the state file. See [cidr_authorization_context](#cidr_authorization_context) for more information. +* `ipamPoolId` - (Required) The ID of the pool to which you want to assign a CIDR. +* `netmaskLength` - (Optional) If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with `cidr`. + +### cidr_authorization_context + +* `message` - (Optional) The plain-text authorization message for the prefix and account. +* `signature` - (Optional) The signed authorization message for the prefix and account. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the IPAM Pool Cidr concatenated with the IPAM Pool ID. +* `ipamPoolCidrId` - The unique ID generated by AWS for the pool cidr. Typically this is the resource `id` but this attribute was added to the API calls after the fact and is therefore not used as the terraform resource id. + +## Import + +IPAMs can be imported using the `_`. Please note we **DO NOT** use the ipam pool cidr id as this was introduced after the resource already existed. An import example: + +``` +$ terraform import aws_vpc_ipam_pool_cidr.example 172.2.0.0/24_ipam-pool-0e634f5a1517cccdc +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam_pool_cidr_allocation.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam_pool_cidr_allocation.html.markdown new file mode 100644 index 00000000000..c9be78b54bf --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam_pool_cidr_allocation.html.markdown @@ -0,0 +1,155 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_pool_cidr_allocation" +description: |- + Allocates (reserves) a CIDR from an IPAM address pool, preventing usage by IPAM. +--- + + + +# Resource: aws_vpc_ipam_pool_cidr_allocation + +Allocates (reserves) a CIDR from an IPAM address pool, preventing usage by IPAM. Only works for private IPv4. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamPool } from "./.gen/providers/aws/vpc-ipam-pool"; +import { VpcIpamPoolCidr } from "./.gen/providers/aws/vpc-ipam-pool-cidr"; +import { VpcIpamPoolCidrAllocation } from "./.gen/providers/aws/vpc-ipam-pool-cidr-allocation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const example = new VpcIpam(this, "example", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const awsVpcIpamPoolExample = new VpcIpamPool(this, "example_2", { + addressFamily: "ipv4", + ipamScopeId: example.privateDefaultScopeId, + locale: Token.asString(current.name), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolExample.overrideLogicalId("example"); + const awsVpcIpamPoolCidrExample = new VpcIpamPoolCidr(this, "example_3", { + cidr: "172.2.0.0/16", + ipamPoolId: Token.asString(awsVpcIpamPoolExample.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrExample.overrideLogicalId("example"); + const awsVpcIpamPoolCidrAllocationExample = new VpcIpamPoolCidrAllocation( + this, + "example_4", + { + cidr: "172.2.0.0/24", + dependsOn: [awsVpcIpamPoolCidrExample], + ipamPoolId: Token.asString(awsVpcIpamPoolExample.id), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrAllocationExample.overrideLogicalId("example"); + } +} + +``` + +With the `disallowedCidrs` attribute: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamPool } from "./.gen/providers/aws/vpc-ipam-pool"; +import { VpcIpamPoolCidr } from "./.gen/providers/aws/vpc-ipam-pool-cidr"; +import { VpcIpamPoolCidrAllocation } from "./.gen/providers/aws/vpc-ipam-pool-cidr-allocation"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const example = new VpcIpam(this, "example", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const awsVpcIpamPoolExample = new VpcIpamPool(this, "example_2", { + addressFamily: "ipv4", + ipamScopeId: example.privateDefaultScopeId, + locale: Token.asString(current.name), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolExample.overrideLogicalId("example"); + const awsVpcIpamPoolCidrExample = new VpcIpamPoolCidr(this, "example_3", { + cidr: "172.2.0.0/16", + ipamPoolId: Token.asString(awsVpcIpamPoolExample.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrExample.overrideLogicalId("example"); + const awsVpcIpamPoolCidrAllocationExample = new VpcIpamPoolCidrAllocation( + this, + "example_4", + { + dependsOn: [awsVpcIpamPoolCidrExample], + disallowedCidrs: ["172.2.0.0/28"], + ipamPoolId: Token.asString(awsVpcIpamPoolExample.id), + netmaskLength: 28, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrAllocationExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `cidr` - (Optional) The CIDR you want to assign to the pool. +* `description` - (Optional) The description for the allocation. +* `disallowedCidrs` - (Optional) Exclude a particular CIDR range from being returned by the pool. +* `ipamPoolId` - (Required) The ID of the pool to which you want to assign a CIDR. +* `netmaskLength` - (Optional) The netmask length of the CIDR you would like to allocate to the IPAM pool. Valid Values: `0128`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the allocation. +* `resourceId` - The ID of the resource. +* `resourceOwner` - The owner of the resource. +* `resourceType` - The type of the resource. + +## Import + +IPAM allocations can be imported using the `allocation id` and `pool id`, separated by `_`, e.g. + +``` +$ terraform import aws_vpc_ipam_pool_cidr_allocation.example ipam-pool-alloc-0dc6d196509c049ba8b549ff99f639736_ipam-pool-07cfb559e0921fcbe +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam_preview_next_cidr.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam_preview_next_cidr.html.markdown new file mode 100644 index 00000000000..c2ff0b4b672 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam_preview_next_cidr.html.markdown @@ -0,0 +1,88 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_preview_next_cidr" +description: |- + Previews a CIDR from an IPAM address pool. +--- + + + +# Resource: aws_vpc_ipam_preview_next_cidr + +Previews a CIDR from an IPAM address pool. Only works for private IPv4. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamPool } from "./.gen/providers/aws/vpc-ipam-pool"; +import { VpcIpamPoolCidr } from "./.gen/providers/aws/vpc-ipam-pool-cidr"; +import { VpcIpamPreviewNextCidr } from "./.gen/providers/aws/vpc-ipam-preview-next-cidr"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const example = new VpcIpam(this, "example", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const awsVpcIpamPoolExample = new VpcIpamPool(this, "example_2", { + addressFamily: "ipv4", + ipamScopeId: example.privateDefaultScopeId, + locale: Token.asString(current.name), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolExample.overrideLogicalId("example"); + const awsVpcIpamPoolCidrExample = new VpcIpamPoolCidr(this, "example_3", { + cidr: "172.2.0.0/16", + ipamPoolId: Token.asString(awsVpcIpamPoolExample.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPoolCidrExample.overrideLogicalId("example"); + const awsVpcIpamPreviewNextCidrExample = new VpcIpamPreviewNextCidr( + this, + "example_4", + { + dependsOn: [awsVpcIpamPoolCidrExample], + disallowedCidrs: ["172.2.0.0/32"], + ipamPoolId: Token.asString(awsVpcIpamPoolExample.id), + netmaskLength: 28, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamPreviewNextCidrExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `disallowedCidrs` - (Optional) Exclude a particular CIDR range from being returned by the pool. +* `ipamPoolId` - (Required) The ID of the pool to which you want to assign a CIDR. +* `netmaskLength` - (Optional) The netmask length of the CIDR you would like to preview from the IPAM pool. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `cidr` - The previewed CIDR from the pool. +* `id` - The ID of the preview. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam_resource_discovery.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam_resource_discovery.html.markdown new file mode 100644 index 00000000000..6d5bd12d312 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam_resource_discovery.html.markdown @@ -0,0 +1,80 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_resource_discovery" +description: |- + Provides an IPAM Resource Discovery resource. +--- + + + +# Resource: aws_vpc_ipam_resource_discovery + +Provides an IPAM Resource Discovery resource. IPAM Resource Discoveries are resources meant for multi-organization customers. If you wish to use a single IPAM across multiple orgs, a resource discovery can be created and shared from a subordinate organization to the management organizations IPAM delegated admin account. For a full deployment example, see `awsVpcIpamResourceDiscoveryAssociation` resource. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpamResourceDiscovery } from "./.gen/providers/aws/vpc-ipam-resource-discovery"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + new VpcIpamResourceDiscovery(this, "main", { + description: "My IPAM Resource Discovery", + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + tags: { + Test: "Main", + }, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `description` - (Optional) A description for the IPAM Resource Discovery. +* `operatingRegions` - (Required) Determines which regions the Resource Discovery will enable IPAM features for usage and monitoring. Locale is the Region where you want to make an IPAM pool available for allocations. You can only create pools with locales that match the operating Regions of the IPAM Resource Discovery. You can only create VPCs from a pool whose locale matches the VPC's Region. You specify a region using the [region_name](#operating_regions) parameter. **You must set your provider block region as an operating_region.** +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### operating_regions + +* `regionName` - (Required) The name of the Region you want to add to the IPAM. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of IPAM Resource Discovery +* `id` - The ID of the IPAM Resource Discovery +* `isDefault` - A boolean to identify if the Resource Discovery is the accounts default resource discovery +* `ownerId` - The account ID for the account that manages the Resource Discovery +* `ipamResourceDiscoveryRegion` - The home region of the Resource Discovery +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +IPAMs can be imported using the `ipam resource discovery id`, e.g. + +``` +$ terraform import aws_vpc_ipam_resource_discovery.example ipam-res-disco-0178368ad2146a492 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam_resource_discovery_association.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam_resource_discovery_association.html.markdown new file mode 100644 index 00000000000..95153c8d64e --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam_resource_discovery_association.html.markdown @@ -0,0 +1,76 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_resource_discovery_association" +description: |- + Provides an IPAM Resource Discovery Association resource. +--- + + + +# Resource: aws_vpc_ipam_resource_discovery_association + +Provides an association between an Amazon IP Address Manager (IPAM) and a IPAM Resource Discovery. IPAM Resource Discoveries are resources meant for multi-organization customers. If you wish to use a single IPAM across multiple orgs, a resource discovery can be created and shared from a subordinate organization to the management organizations IPAM delegated admin account. + +Once an association is created between two organizations via IPAM & a IPAM Resource Discovery, IPAM Pools can be shared via Resource Access Manager (RAM) to accounts in the subordinate organization; these RAM shares must be accepted by the end user account. Pools can then also discover and monitor IPAM resources in the subordinate organization. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcIpamResourceDiscoveryAssociation } from "./.gen/providers/aws/vpc-ipam-resource-discovery-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcIpamResourceDiscoveryAssociation(this, "test", { + ipamId: Token.asString(awsVpcIpamTest.id), + ipamResourceDiscoveryId: Token.asString( + awsVpcIpamResourceDiscoveryTest.id + ), + tags: { + Name: "test", + }, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `ipamId` - (Required) The ID of the IPAM to associate. +* `ipamResourceDiscoveryId` - (Required) The ID of the Resource Discovery to associate. +* `tags` - (Optional) A map of tags to add to the IPAM resource discovery association resource. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of IPAM Resource Discovery Association. +* `id` - The ID of the IPAM Resource Discovery Association. +* `ownerId` - The account ID for the account that manages the Resource Discovery +* `ipamArn` - The Amazon Resource Name (ARN) of the IPAM. +* `ipamRegion` - The home region of the IPAM. +* `isDefault` - A boolean to identify if the Resource Discovery is the accounts default resource discovery. +* `state` - The lifecycle state of the association when you associate or disassociate a resource discovery. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +IPAMs can be imported using the `ipam resource discovery association id`, e.g. + +``` +$ terraform import aws_vpc_ipam_resource_discovery_association.example ipam-res-disco-assoc-0178368ad2146a492 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipam_scope.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipam_scope.html.markdown new file mode 100644 index 00000000000..144d525551c --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipam_scope.html.markdown @@ -0,0 +1,79 @@ +--- +subcategory: "VPC IPAM (IP Address Manager)" +layout: "aws" +page_title: "AWS: aws_vpc_ipam_scope" +description: |- + Creates a scope for AWS IPAM. +--- + + + +# Resource: aws_vpc_ipam_scope + +Creates a scope for AWS IPAM. + +## Example Usage + +Basic usage: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsRegion } from "./.gen/providers/aws/data-aws-region"; +import { VpcIpam } from "./.gen/providers/aws/vpc-ipam"; +import { VpcIpamScope } from "./.gen/providers/aws/vpc-ipam-scope"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const current = new DataAwsRegion(this, "current", {}); + const example = new VpcIpam(this, "example", { + operatingRegions: [ + { + regionName: Token.asString(current.name), + }, + ], + }); + const awsVpcIpamScopeExample = new VpcIpamScope(this, "example_2", { + description: "Another Scope", + ipamId: example.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpamScopeExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `ipamId` - The ID of the IPAM for which you're creating this scope. +* `description` - (Optional) A description for the scope you're creating. +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the scope. +* `id` - The ID of the IPAM Scope. +* `ipamArn` - The ARN of the IPAM for which you're creating this scope. +* `isDefault` - Defines if the scope is the default scope or not. +* `poolCount` - The number of pools in the scope. +* `type` - The type of the scope. + +## Import + +IPAMs can be imported using the `scopeId`, e.g. + +``` +$ terraform import aws_vpc_ipam_scope.example ipam-scope-0513c69f283d11dfb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipv4_cidr_block_association.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipv4_cidr_block_association.html.markdown new file mode 100644 index 00000000000..35607af0813 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipv4_cidr_block_association.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_ipv4_cidr_block_association" +description: |- + Associate additional IPv4 CIDR blocks with a VPC +--- + + + +# Resource: aws_vpc_ipv4_cidr_block_association + +Provides a resource to associate additional IPv4 CIDR blocks with a VPC. + +When a VPC is created, a primary IPv4 CIDR block for the VPC must be specified. +The `awsVpcIpv4CidrBlockAssociation` resource allows further IPv4 CIDR blocks to be added to the VPC. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcIpv4CidrBlockAssociation } from "./.gen/providers/aws/vpc-ipv4-cidr-block-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const main = new Vpc(this, "main", { + cidrBlock: "10.0.0.0/16", + }); + new VpcIpv4CidrBlockAssociation(this, "secondary_cidr", { + cidrBlock: "172.2.0.0/16", + vpcId: main.id, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `cidrBlock` - (Optional) The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv4NetmaskLength`. +* `ipv4IpamPoolId` - (Optional) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization. +* `ipv4NetmaskLength` - (Optional) The netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a `ipv4IpamPoolId`. +* `vpcId` - (Required) The ID of the VPC to make the association with. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC CIDR association + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `10M`) +- `delete` - (Default `10M`) + +## Import + +`awsVpcIpv4CidrBlockAssociation` can be imported by using the VPC CIDR Association ID, e.g., + +``` +$ terraform import aws_vpc_ipv4_cidr_block_association.example vpc-cidr-assoc-xxxxxxxx +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_ipv6_cidr_block_association.html.markdown b/website/docs/cdktf/typescript/r/vpc_ipv6_cidr_block_association.html.markdown new file mode 100644 index 00000000000..32ee8c004c0 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_ipv6_cidr_block_association.html.markdown @@ -0,0 +1,80 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_ipv6_cidr_block_association" +description: |- + Associate additional IPv6 CIDR blocks with a VPC +--- + + + +# Resource: aws_vpc_ipv6_cidr_block_association + +Provides a resource to associate additional IPv6 CIDR blocks with a VPC. + +The `awsVpcIpv6CidrBlockAssociation` resource allows IPv6 CIDR blocks to be added to the VPC. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcIpv6CidrBlockAssociation } from "./.gen/providers/aws/vpc-ipv6-cidr-block-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const test = new Vpc(this, "test", { + cidrBlock: "10.0.0.0/16", + }); + const awsVpcIpv6CidrBlockAssociationTest = new VpcIpv6CidrBlockAssociation( + this, + "test_1", + { + ipv6IpamPoolId: Token.asString(awsVpcIpamPoolTest.id), + vpcId: test.id, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcIpv6CidrBlockAssociationTest.overrideLogicalId("test"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `ipv6CidrBlock` - (Optional) The IPv6 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv6NetmaskLength`. This parameter is required if `ipv6NetmaskLength` is not set and he IPAM pool does not have `allocationDefaultNetmask` set. +* `ipv6IpamPoolId` - (Required) The ID of an IPv6 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. +* `ipv6NetmaskLength` - (Optional) The netmask length of the IPv6 CIDR you want to allocate to this VPC. Requires specifying a `ipv6IpamPoolId`. This parameter is optional if the IPAM pool has `allocationDefaultNetmask` set, otherwise it or `cidrBlock` are required +* `vpcId` - (Required) The ID of the VPC to make the association with. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `10M`) +- `delete` - (Default `10M`) + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC CIDR association + +## Import + +`awsVpcIpv6CidrBlockAssociation` can be imported by using the VPC CIDR Association ID, e.g., + +``` +$ terraform import aws_vpc_ipv6_cidr_block_association.example vpc-cidr-assoc-xxxxxxxx +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_network_performance_metric_subscription.html.markdown b/website/docs/cdktf/typescript/r/vpc_network_performance_metric_subscription.html.markdown new file mode 100644 index 00000000000..f59d7507bc1 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_network_performance_metric_subscription.html.markdown @@ -0,0 +1,53 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_network_performance_metric_subscription" +description: |- + Provides a resource to manage an Infrastructure Performance subscription. +--- + + + +# Resource: aws_vpc_network_performance_metric_subscription + +Provides a resource to manage an Infrastructure Performance subscription. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcNetworkPerformanceMetricSubscription } from "./.gen/providers/aws/vpc-network-performance-metric-subscription"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcNetworkPerformanceMetricSubscription(this, "example", { + destination: "us-west-1", + source: "us-east-1", + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `destination` - (Required) The target Region or Availability Zone that the metric subscription is enabled for. For example, `euWest1`. +* `metric` - (Optional) The metric used for the enabled subscription. Valid values: `aggregateLatency`. Default: `aggregateLatency`. +* `source` - (Required) The source Region or Availability Zone that the metric subscription is enabled for. For example, `usEast1`. +* `statistic` - (Optional) The statistic used for the enabled subscription. Valid values: `p50`. Default: `p50`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `period` - The data aggregation time for the subscription. + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_peering_connection.html.markdown b/website/docs/cdktf/typescript/r/vpc_peering_connection.html.markdown new file mode 100644 index 00000000000..d9da4e7b773 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_peering_connection.html.markdown @@ -0,0 +1,218 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connection" +description: |- + Provides a resource to manage a VPC peering connection. +--- + + + +# Resource: aws_vpc_peering_connection + +Provides a resource to manage a VPC peering connection. + +~> **NOTE on VPC Peering Connections and VPC Peering Connection Options:** Terraform provides +both a standalone [VPC Peering Connection Options](vpc_peering_connection_options.html) and a VPC Peering Connection +resource with `accepter` and `requester` attributes. Do not manage options for the same VPC peering +connection in both a VPC Peering Connection resource and a VPC Peering Connection Options resource. +Doing so will cause a conflict of options and will overwrite the options. +Using a VPC Peering Connection Options resource decouples management of the connection options from +management of the VPC Peering Connection and allows options to be set correctly in cross-account scenarios. + +-> **Note:** For cross-account (requester's AWS account differs from the accepter's AWS account) or inter-region +VPC Peering Connections use the `awsVpcPeeringConnection` resource to manage the requester's side of the +connection and use the `awsVpcPeeringConnectionAccepter` resource to manage the accepter's side of the connection. + +-> **Note:** Creating multiple `awsVpcPeeringConnection` resources with the same `peerVpcId` and `vpcId` will not produce an error. Instead, AWS will return the connection `id` that already exists, resulting in multiple `awsVpcPeeringConnection` resources with the same `id`. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcPeeringConnection } from "./.gen/providers/aws/vpc-peering-connection"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcPeeringConnection(this, "foo", { + peerOwnerId: peerOwnerId.stringValue, + peerVpcId: bar.id, + vpcId: Token.asString(awsVpcFoo.id), + }); + } +} + +``` + +Basic usage with connection options: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcPeeringConnection } from "./.gen/providers/aws/vpc-peering-connection"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcPeeringConnection(this, "foo", { + accepter: { + allowRemoteVpcDnsResolution: true, + }, + peerOwnerId: peerOwnerId.stringValue, + peerVpcId: bar.id, + requester: { + allowRemoteVpcDnsResolution: true, + }, + vpcId: Token.asString(awsVpcFoo.id), + }); + } +} + +``` + +Basic usage with tags: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcPeeringConnection } from "./.gen/providers/aws/vpc-peering-connection"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const bar = new Vpc(this, "bar", { + cidrBlock: "10.2.0.0/16", + }); + const foo = new Vpc(this, "foo", { + cidrBlock: "10.1.0.0/16", + }); + const awsVpcPeeringConnectionFoo = new VpcPeeringConnection(this, "foo_2", { + autoAccept: true, + peerOwnerId: peerOwnerId.stringValue, + peerVpcId: bar.id, + tags: { + Name: "VPC Peering between foo and bar", + }, + vpcId: foo.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcPeeringConnectionFoo.overrideLogicalId("foo"); + } +} + +``` + +Basic usage with region: + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcPeeringConnection } from "./.gen/providers/aws/vpc-peering-connection"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const bar = new Vpc(this, "bar", { + cidrBlock: "10.2.0.0/16", + provider: usEast1, + }); + const foo = new Vpc(this, "foo", { + cidrBlock: "10.1.0.0/16", + provider: usWest2, + }); + const awsVpcPeeringConnectionFoo = new VpcPeeringConnection(this, "foo_2", { + peerOwnerId: peerOwnerId.stringValue, + peerRegion: "us-east-1", + peerVpcId: bar.id, + vpcId: foo.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcPeeringConnectionFoo.overrideLogicalId("foo"); + } +} + +``` + +## Argument Reference + +-> **Note:** Modifying the VPC Peering Connection options requires peering to be active. An automatic activation +can be done using the [`autoAccept`](vpc_peering_connection.html#auto_accept) attribute. Alternatively, the VPC Peering +Connection has to be made active manually using other means. See [notes](vpc_peering_connection.html#notes) below for +more information. + +The following arguments are supported: + +* `peerOwnerId` - (Optional) The AWS account ID of the owner of the peer VPC. + Defaults to the account ID the [AWS provider][1] is currently connected to. +* `peerVpcId` - (Required) The ID of the VPC with which you are creating the VPC Peering Connection. +* `vpcId` - (Required) The ID of the requester VPC. +* `autoAccept` - (Optional) Accept the peering (both VPCs need to be in the same AWS account and region). +* `peerRegion` - (Optional) The region of the accepter VPC of the VPC Peering Connection. `autoAccept` must be `false`, +and use the `awsVpcPeeringConnectionAccepter` to manage the accepter side. +* `accepter` (Optional) - An optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that accepts +the peering connection (a maximum of one). +* `requester` (Optional) - A optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requests +the peering connection (a maximum of one). +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +#### Accepter and Requester Arguments + +-> **Note:** When enabled, the DNS resolution feature requires that VPCs participating in the peering +must have support for the DNS hostnames enabled. This can be done using the [`enableDnsHostnames`](vpc.html#enable_dns_hostnames) attribute in the [`awsVpc`](vpc.html) resource. See [Using DNS with Your VPC](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html) user guide for more information. + +* `allowRemoteVpcDnsResolution` - (Optional) Allow a local VPC to resolve public DNS hostnames to +private IP addresses when queried from instances in the peer VPC. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC Peering Connection. +* `acceptStatus` - The status of the VPC Peering Connection request. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Notes + +If both VPCs are not in the same AWS account and region do not enable the `autoAccept` attribute. +The accepter can manage its side of the connection using the `awsVpcPeeringConnectionAccepter` resource +or accept the connection manually using the AWS Management Console, AWS CLI, through SDKs, etc. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `1M`) +- `update` - (Default `1M`) +- `delete` - (Default `1M`) + +## Import + +VPC Peering resources can be imported using the `vpc peering id`, e.g., + +```sh +$ terraform import aws_vpc_peering_connection.test_connection pcx-111aaa111 +``` + +[1]: /docs/providers/aws/index.html + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_peering_connection_accepter.html.markdown b/website/docs/cdktf/typescript/r/vpc_peering_connection_accepter.html.markdown new file mode 100644 index 00000000000..6b07d55a966 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_peering_connection_accepter.html.markdown @@ -0,0 +1,168 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connection_accepter" +description: |- + Manage the accepter's side of a VPC Peering Connection. +--- + + + +# Resource: aws_vpc_peering_connection_accepter + +Provides a resource to manage the accepter's side of a VPC Peering Connection. + +When a cross-account (requester's AWS account differs from the accepter's AWS account) or an inter-region +VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the +accepter's account. +The requester can use the `awsVpcPeeringConnection` resource to manage its side of the connection +and the accepter can use the `awsVpcPeeringConnectionAccepter` resource to "adopt" its side of the +connection into management. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsCallerIdentity } from "./.gen/providers/aws/data-aws-caller-identity"; +import { AwsProvider } from "./.gen/providers/aws/provider"; +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcPeeringConnection } from "./.gen/providers/aws/vpc-peering-connection"; +import { VpcPeeringConnectionAccepterA } from "./.gen/providers/aws/vpc-peering-connection-accepter"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new AwsProvider(this, "aws", { + region: "us-east-1", + }); + const peer = new AwsProvider(this, "aws_1", { + alias: "peer", + region: "us-west-2", + }); + const main = new Vpc(this, "main", { + cidrBlock: "10.0.0.0/16", + }); + const awsVpcPeer = new Vpc(this, "peer", { + cidrBlock: "10.1.0.0/16", + provider: peer, + }); + const dataAwsCallerIdentityPeer = new DataAwsCallerIdentity( + this, + "peer_4", + { + provider: peer, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataAwsCallerIdentityPeer.overrideLogicalId("peer"); + const awsVpcPeeringConnectionPeer = new VpcPeeringConnection( + this, + "peer_5", + { + autoAccept: false, + peerOwnerId: Token.asString(dataAwsCallerIdentityPeer.accountId), + peerRegion: "us-west-2", + peerVpcId: Token.asString(awsVpcPeer.id), + tags: { + Side: "Requester", + }, + vpcId: main.id, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcPeeringConnectionPeer.overrideLogicalId("peer"); + const awsVpcPeeringConnectionAccepterPeer = + new VpcPeeringConnectionAccepterA(this, "peer_6", { + autoAccept: true, + provider: peer, + tags: { + Side: "Accepter", + }, + vpcPeeringConnectionId: Token.asString(awsVpcPeeringConnectionPeer.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcPeeringConnectionAccepterPeer.overrideLogicalId("peer"); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `vpcPeeringConnectionId` - (Required) The VPC Peering Connection ID to manage. +* `autoAccept` - (Optional) Whether or not to accept the peering request. Defaults to `false`. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### Removing `awsVpcPeeringConnectionAccepter` from your configuration + +AWS allows a cross-account VPC Peering Connection to be deleted from either the requester's or accepter's side. +However, Terraform only allows the VPC Peering Connection to be deleted from the requester's side +by removing the corresponding `awsVpcPeeringConnection` resource from your configuration. +Removing a `awsVpcPeeringConnectionAccepter` resource from your configuration will remove it +from your statefile and management, **but will not destroy the VPC Peering Connection.** + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC Peering Connection. +* `acceptStatus` - The status of the VPC Peering Connection request. +* `vpcId` - The ID of the accepter VPC. +* `peerVpcId` - The ID of the requester VPC. +* `peerOwnerId` - The AWS account ID of the owner of the requester VPC. +* `peerRegion` - The region of the accepter VPC. +* `accepter` - A configuration block that describes [VPC Peering Connection] +(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC. +* `requester` - A configuration block that describes [VPC Peering Connection] +(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +#### Accepter and Requester Attributes Reference + +* `allowRemoteVpcDnsResolution` - Indicates whether a local VPC can resolve public DNS hostnames to +private IP addresses when queried from instances in a peer VPC. + +## Import + +VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g., + +```sh +$ terraform import aws_vpc_peering_connection_accepter.example pcx-12345678 +``` + +Certain resource arguments, like `autoAccept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use [`ignoreChanges`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g., + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcPeeringConnectionAccepterA } from "./.gen/providers/aws/vpc-peering-connection-accepter"; +interface MyConfig { + vpcPeeringConnectionId: any; +} +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string, config: MyConfig) { + super(scope, name); + new VpcPeeringConnectionAccepterA(this, "example", { + lifecycle: { + ignoreChanges: [autoAccept], + }, + vpcPeeringConnectionId: config.vpcPeeringConnectionId, + }); + } +} + +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_peering_connection_options.html.markdown b/website/docs/cdktf/typescript/r/vpc_peering_connection_options.html.markdown new file mode 100644 index 00000000000..04047ffadd3 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_peering_connection_options.html.markdown @@ -0,0 +1,196 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_peering_connection_options" +description: |- + Provides a resource to manage VPC peering connection options. +--- + + + +# Resource: aws_vpc_peering_connection_options + +Provides a resource to manage VPC peering connection options. + +~> **NOTE on VPC Peering Connections and VPC Peering Connection Options:** Terraform provides +both a standalone VPC Peering Connection Options and a [VPC Peering Connection](vpc_peering_connection.html) +resource with `accepter` and `requester` attributes. Do not manage options for the same VPC peering +connection in both a VPC Peering Connection resource and a VPC Peering Connection Options resource. +Doing so will cause a conflict of options and will overwrite the options. +Using a VPC Peering Connection Options resource decouples management of the connection options from +management of the VPC Peering Connection and allows options to be set correctly in cross-region and +cross-account scenarios. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcPeeringConnection } from "./.gen/providers/aws/vpc-peering-connection"; +import { VpcPeeringConnectionOptions } from "./.gen/providers/aws/vpc-peering-connection-options"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const bar = new Vpc(this, "bar", { + cidrBlock: "10.1.0.0/16", + }); + const foo = new Vpc(this, "foo", { + cidrBlock: "10.0.0.0/16", + }); + const awsVpcPeeringConnectionFoo = new VpcPeeringConnection(this, "foo_2", { + autoAccept: true, + peerVpcId: bar.id, + vpcId: foo.id, + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcPeeringConnectionFoo.overrideLogicalId("foo"); + const awsVpcPeeringConnectionOptionsFoo = new VpcPeeringConnectionOptions( + this, + "foo_3", + { + accepter: { + allowRemoteVpcDnsResolution: true, + }, + vpcPeeringConnectionId: Token.asString(awsVpcPeeringConnectionFoo.id), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcPeeringConnectionOptionsFoo.overrideLogicalId("foo"); + } +} + +``` + +### Cross-Account Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsCallerIdentity } from "./.gen/providers/aws/data-aws-caller-identity"; +import { AwsProvider } from "./.gen/providers/aws/provider"; +import { Vpc } from "./.gen/providers/aws/vpc"; +import { VpcPeeringConnection } from "./.gen/providers/aws/vpc-peering-connection"; +import { VpcPeeringConnectionAccepterA } from "./.gen/providers/aws/vpc-peering-connection-accepter"; +import { VpcPeeringConnectionOptions } from "./.gen/providers/aws/vpc-peering-connection-options"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const requester = new AwsProvider(this, "aws", { + alias: "requester", + }); + const accepter = new AwsProvider(this, "aws_1", { + alias: "accepter", + }); + const main = new Vpc(this, "main", { + cidrBlock: "10.0.0.0/16", + enableDnsHostnames: true, + enableDnsSupport: true, + provider: requester, + }); + const peer = new Vpc(this, "peer", { + cidrBlock: "10.1.0.0/16", + enableDnsHostnames: true, + enableDnsSupport: true, + provider: accepter, + }); + const dataAwsCallerIdentityPeer = new DataAwsCallerIdentity( + this, + "peer_4", + { + provider: accepter, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataAwsCallerIdentityPeer.overrideLogicalId("peer"); + const awsVpcPeeringConnectionPeer = new VpcPeeringConnection( + this, + "peer_5", + { + autoAccept: false, + peerOwnerId: Token.asString(dataAwsCallerIdentityPeer.accountId), + peerVpcId: peer.id, + provider: requester, + tags: { + Side: "Requester", + }, + vpcId: main.id, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcPeeringConnectionPeer.overrideLogicalId("peer"); + const awsVpcPeeringConnectionAccepterPeer = + new VpcPeeringConnectionAccepterA(this, "peer_6", { + autoAccept: true, + provider: accepter, + tags: { + Side: "Accepter", + }, + vpcPeeringConnectionId: Token.asString(awsVpcPeeringConnectionPeer.id), + }); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpcPeeringConnectionAccepterPeer.overrideLogicalId("peer"); + new VpcPeeringConnectionOptions(this, "accepter", { + accepter: { + allowRemoteVpcDnsResolution: true, + }, + provider: accepter, + vpcPeeringConnectionId: Token.asString( + awsVpcPeeringConnectionAccepterPeer.id + ), + }); + new VpcPeeringConnectionOptions(this, "requester", { + provider: requester, + requester: { + allowRemoteVpcDnsResolution: true, + }, + vpcPeeringConnectionId: Token.asString( + awsVpcPeeringConnectionAccepterPeer.id + ), + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `vpcPeeringConnectionId` - (Required) The ID of the requester VPC peering connection. +* `accepter` (Optional) - An optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that acceptsthe peering connection (a maximum of one). +* `requester` (Optional) - A optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requeststhe peering connection (a maximum of one). + +#### Accepter and Requester Arguments + +-> **Note:** When enabled, the DNS resolution feature requires that VPCs participating in the peering must have support for the DNS hostnames enabled. This can be done using the [`enableDnsHostnames`](vpc.html#enable_dns_hostnames) attribute in the [`awsVpc`](vpc.html) resource. See [Using DNS with Your VPC](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html) user guide for more information. + +* `allowRemoteVpcDnsResolution` - (Optional) Allow a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the VPC Peering Connection Options. + +## Import + +VPC Peering Connection Options can be imported using the `vpc peering id`, e.g., + +``` +$ terraform import aws_vpc_peering_connection_options.foo pcx-111aaa111 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_security_group_egress_rule.html.markdown b/website/docs/cdktf/typescript/r/vpc_security_group_egress_rule.html.markdown new file mode 100644 index 00000000000..691bf571a24 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_security_group_egress_rule.html.markdown @@ -0,0 +1,79 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_security_group_egress_rule" +description: |- + Provides a VPC security group egress rule resource. +--- + + + +# Resource: aws_vpc_security_group_egress_rule + +Manages an outbound (egress) rule for a security group. + +When specifying an outbound rule for your security group in a VPC, the configuration must include a destination for the traffic. + +~> **NOTE on Security Groups and Security Group Rules:** Terraform currently provides a [Security Group resource](security_group.html) with `ingress` and `egress` rules defined in-line and a [Security Group Rule resource](security_group_rule.html) which manages one or more `ingress` or +`egress` rules. Both of these resource were added before AWS assigned a [security group rule unique ID](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html), and they do not work well in all scenarios using the`description` and `tags` attributes, which rely on the unique ID. +The `awsVpcSecurityGroupEgressRule` resource has been added to address these limitations and should be used for all new security group rules. +You should not use the `awsVpcSecurityGroupEgressRule` resource in conjunction with an `awsSecurityGroup` resource with in-line rules or with `awsSecurityGroupRule` resources defined for the same Security Group, as rule conflicts may occur and rules will be overwritten. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcSecurityGroupEgressRule } from "./.gen/providers/aws/vpc-security-group-egress-rule"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcSecurityGroupEgressRule(this, "example", { + cidrIpv4: "10.0.0.0/8", + fromPort: 80, + ipProtocol: "tcp", + securityGroupId: Token.asString(awsSecurityGroupExample.id), + toPort: 8080, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `cidrIpv4` - (Optional) The destination IPv4 CIDR range. +* `cidrIpv6` - (Optional) The destination IPv6 CIDR range. +* `description` - (Optional) The security group rule description. +* `fromPort` - (Optional) The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. +* `ipProtocol` - (Optional) The IP protocol name or number. Use `1` to specify all protocols. Note that if `ipProtocol` is set to `1`, it translates to all protocols, all port ranges, and `fromPort` and `toPort` values should not be defined. +* `prefixListId` - (Optional) The ID of the destination prefix list. +* `referencedSecurityGroupId` - (Optional) The destination security group that is referenced in the rule. +* `securityGroupId` - (Required) The ID of the security group. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `toPort` - (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the security group rule. +* `securityGroupRuleId` - The ID of the security group rule. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +Security group egress rules can be imported using the `securityGroupRuleId`, e.g., + +``` +$ terraform import aws_vpc_security_group_egress_rule.example sgr-02108b27edd666983 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpc_security_group_ingress_rule.html.markdown b/website/docs/cdktf/typescript/r/vpc_security_group_ingress_rule.html.markdown new file mode 100644 index 00000000000..ed4f3fbc583 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpc_security_group_ingress_rule.html.markdown @@ -0,0 +1,79 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_security_group_ingress_rule" +description: |- + Provides a VPC security group ingress rule resource. +--- + + + +# Resource: aws_vpc_security_group_ingress_rule + +Manages an inbound (ingress) rule for a security group. + +When specifying an inbound rule for your security group in a VPC, the configuration must include a source for the traffic. + +~> **NOTE on Security Groups and Security Group Rules:** Terraform currently provides a [Security Group resource](security_group.html) with `ingress` and `egress` rules defined in-line and a [Security Group Rule resource](security_group_rule.html) which manages one or more `ingress` or +`egress` rules. Both of these resource were added before AWS assigned a [security group rule unique ID](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html), and they do not work well in all scenarios using the`description` and `tags` attributes, which rely on the unique ID. +The `awsVpcSecurityGroupIngressRule` resource has been added to address these limitations and should be used for all new security group rules. +You should not use the `awsVpcSecurityGroupIngressRule` resource in conjunction with an `awsSecurityGroup` resource with in-line rules or with `awsSecurityGroupRule` resources defined for the same Security Group, as rule conflicts may occur and rules will be overwritten. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpcSecurityGroupIngressRule } from "./.gen/providers/aws/vpc-security-group-ingress-rule"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpcSecurityGroupIngressRule(this, "example", { + cidrIpv4: "10.0.0.0/8", + fromPort: 80, + ipProtocol: "tcp", + securityGroupId: Token.asString(awsSecurityGroupExample.id), + toPort: 8080, + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `cidrIpv4` - (Optional) The source IPv4 CIDR range. +* `cidrIpv6` - (Optional) The source IPv6 CIDR range. +* `description` - (Optional) The security group rule description. +* `fromPort` - (Optional) The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type. +* `ipProtocol` - (Optional) The IP protocol name or number. Use `1` to specify all protocols. Note that if `ipProtocol` is set to `1`, it translates to all protocols, all port ranges, and `fromPort` and `toPort` values should not be defined. +* `prefixListId` - (Optional) The ID of the source prefix list. +* `referencedSecurityGroupId` - (Optional) The source security group that is referenced in the rule. +* `securityGroupId` - (Required) The ID of the security group. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `toPort` - (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) of the security group rule. +* `securityGroupRuleId` - The ID of the security group rule. +* `tagsAll` - A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block). + +## Import + +Security group ingress rules can be imported using the `securityGroupRuleId`, e.g., + +``` +$ terraform import aws_vpc_security_group_ingress_rule.example sgr-02108b27edd666983 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_access_log_subscription.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_access_log_subscription.html.markdown new file mode 100644 index 00000000000..079252ad2ff --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_access_log_subscription.html.markdown @@ -0,0 +1,65 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_access_log_subscription" +description: |- + Terraform resource for managing an AWS VPC Lattice Service Network or Services Access log subscription. +--- + + + +# Resource: aws_vpclattice_access_log_subscription + +Terraform resource for managing an AWS VPC Lattice Service Network or Service Access log subscription. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeAccessLogSubscription } from "./.gen/providers/aws/vpclattice-access-log-subscription"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeAccessLogSubscription(this, "example", { + destinationArn: Token.asString(bucket.arn), + resourceIdentifier: Token.asString(awsVpclatticeServiceNetworkExample.id), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `destinationArn` - (Required) Amazon Resource Name (ARN) of the log destination. +* `resourceIdentifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service network or service. You must use the ARN if the resources specified in the operation are in different accounts. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the access log subscription. +* `arn` - Amazon Resource Name (ARN) of the access log subscription. +* `resourceIdentifier` - ID of the service network or service. +* `resourceArn` - Amazon Resource Name (ARN) of the service network or service. +* `destinationArn` - Amazon Resource Name (ARN) of the log destination. + +## Import + +VPC Lattice Access Log Subscription can be imported using the access log subscription ID, e.g., + +``` +$ terraform import aws_vpclattice_access_log_subscription.example rft-8012925589 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_auth_policy.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_auth_policy.html.markdown new file mode 100644 index 00000000000..e14642a2185 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_auth_policy.html.markdown @@ -0,0 +1,99 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_auth_policy" +description: |- + Terraform resource for managing an AWS VPC Lattice Auth Policy. +--- + + + +# Resource: aws_vpclattice_auth_policy + +Terraform resource for managing an AWS VPC Lattice Auth Policy. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeAuthPolicy } from "./.gen/providers/aws/vpclattice-auth-policy"; +import { VpclatticeService } from "./.gen/providers/aws/vpclattice-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new VpclatticeService(this, "example", { + authType: "AWS_IAM", + customDomainName: "example.com", + name: "example-vpclattice-service", + }); + const awsVpclatticeAuthPolicyExample = new VpclatticeAuthPolicy( + this, + "example_1", + { + policy: Token.asString( + Fn.jsonencode({ + Statement: [ + { + Action: "*", + Condition: { + StringNotEqualsIgnoreCase: { + "aws:PrincipalType": "anonymous", + }, + }, + Effect: "Allow", + Principal: "*", + Resource: "*", + }, + ], + Version: "2012-10-17", + }) + ), + resourceIdentifier: example.arn, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpclatticeAuthPolicyExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `resourceIdentifier` - (Required) The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created. +* `policy` - (Required) The auth policy. The policy string in JSON must not contain newlines or blank lines. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `policy` - The auth policy. The policy string in JSON must not contain newlines or blank lines. +* `state` - The state of the auth policy. The auth policy is only active when the auth type is set to AWS_IAM. If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the Auth type is NONE, then, any auth policy you provide will remain inactive. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `60M`) +* `update` - (Default `180M`) +* `delete` - (Default `90M`) + +## Import + +VPC Lattice Auth Policy can be imported using the `exampleIdArg`, e.g., + +``` +$ terraform import aws_vpclattice_auth_policy.example rft-8012925589 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_listener.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_listener.html.markdown new file mode 100644 index 00000000000..e7531cd15d7 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_listener.html.markdown @@ -0,0 +1,213 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_listener" +description: |- + Terraform resource for managing an AWS VPC Lattice Listener. +--- + + + +# Resource: aws_vpclattice_listener + +Terraform resource for managing an AWS VPC Lattice Listener. + +## Example Usage + +### Fixed response action + +``` +resource "aws_vpclattice_service" "test" { + name = %[1]q +} + +resource "aws_vpclattice_listener" "test" { + name = %[1]q + protocol = "HTTPS" + service_identifier = aws_vpclattice_service.test.id + default_action { + fixed_response { + status_code = 404 + } + } +} +``` + +### Forward action + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeListener } from "./.gen/providers/aws/vpclattice-listener"; +import { VpclatticeService } from "./.gen/providers/aws/vpclattice-service"; +import { VpclatticeTargetGroup } from "./.gen/providers/aws/vpclattice-target-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeService(this, "test", { + name: "example", + }); + const example = new VpclatticeTargetGroup(this, "example", { + config: { + port: 80, + protocol: "HTTP", + vpcIdentifier: Token.asString(awsVpcTest.id), + }, + name: "example-target-group-1", + type: "INSTANCE", + }); + const awsVpclatticeListenerExample = new VpclatticeListener( + this, + "example_2", + { + defaultAction: { + forward: [ + { + targetGroups: [ + { + targetGroupIdentifier: example.id, + }, + ], + }, + ], + }, + name: "example", + protocol: "HTTP", + serviceIdentifier: Token.asString(awsVpclatticeServiceExample.id), + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpclatticeListenerExample.overrideLogicalId("example"); + } +} + +``` + +### Forward action with weighted target groups + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeListener } from "./.gen/providers/aws/vpclattice-listener"; +import { VpclatticeService } from "./.gen/providers/aws/vpclattice-service"; +import { VpclatticeTargetGroup } from "./.gen/providers/aws/vpclattice-target-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeService(this, "test", { + name: "example", + }); + const example1 = new VpclatticeTargetGroup(this, "example1", { + config: { + port: 80, + protocol: "HTTP", + vpcIdentifier: Token.asString(awsVpcTest.id), + }, + name: "example-target-group-1", + type: "INSTANCE", + }); + const example2 = new VpclatticeTargetGroup(this, "example2", { + config: { + port: 8080, + protocol: "HTTP", + vpcIdentifier: Token.asString(awsVpcTest.id), + }, + name: "example-target-group-2", + type: "INSTANCE", + }); + new VpclatticeListener(this, "example", { + defaultAction: { + forward: [ + { + targetGroups: [ + { + targetGroupIdentifier: example1.id, + weight: 80, + }, + { + targetGroupIdentifier: example2.id, + weight: 20, + }, + ], + }, + ], + }, + name: "example", + protocol: "HTTP", + serviceIdentifier: Token.asString(awsVpclatticeServiceExample.id), + }); + } +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `defaultAction` - (Required) Default action block for the default listener rule. Default action blocks are defined below. +* `name` - (Required, Forces new resource) Name of the listener. A listener name must be unique within a service. Valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen. +* `port` - (Optional, Forces new resource) Listener port. You can specify a value from 1 to 65535. If `port` is not specified and `protocol` is HTTP, the value will default to 80. If `port` is not specified and `protocol` is HTTPS, the value will default to 443. +* `protocol` - (Required, Forces new resource) Protocol for the listener. Supported values are `http` or `https` +* `serviceArn` - (Optional) Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the `serviceArn` or `serviceIdentifier` arguments. +* `serviceIdentifier` - (Optional) ID of the VPC Lattice service. You must include either the `serviceArn` or `serviceIdentifier` arguments. +-> **NOTE:** You must specify one of the following arguments: `serviceArn` or `serviceIdentifier`. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### Default Action + +Default action blocks (for `defaultAction`) must include at least one of the following argument blocks: + +* `fixedResponse` - (Optional) Configuration block for returning a fixed response. See Fixed Response blocks below. +* `forward` - (Optional) Route requests to one or more target groups. See Forward blocks below. + +-> **NOTE:** You must specify exactly one of the following argument blocks: `fixedResponse` or `forward`. + +### Fixed Response + +Fixed response blocks (for `fixedResponse`) must include the following argument: + +* `statusCode` - (Required) Custom HTTP status code to return, e.g. a 404 response code. See [Listeners](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html) in the AWS documentation for a list of supported codes. + +### Forward + +Forward blocks (for `forward`) must include the following arguments: + +* `targetGroups` - (Required) One or more target group blocks. + +### Target Groups + +Target group blocks (for `targetGroup`) must include the following arguments: + +* `targetGroupIdentifier` - (Required) ID or Amazon Resource Name (ARN) of the target group. +* `weight` - (Optional) Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a +weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See [Listener rules](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) in the AWS documentation for additional examples. Default: `100`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the listener. +* `createdAt` - Date and time that the listener was created, specified in ISO-8601 format. +* `listenerId` - Standalone ID of the listener, e.g. `listener0A1B2C3D4E5F6G`. +* `updatedAt` - Date and time that the listener was last updated, specified in ISO-8601 format. + +## Import + +VPC Lattice Listener can be imported by using the `listenerId` of the listener and the `id` of the VPC Lattice service combined with a `/` character, e.g.: + +``` +$ terraform import aws_vpclattice_listener.example svc-1a2b3c4d/listener-987654321 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_listener_rule.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_listener_rule.html.markdown new file mode 100644 index 00000000000..20846948c6e --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_listener_rule.html.markdown @@ -0,0 +1,201 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_listener_rule" +description: |- + Terraform resource for managing an AWS VPC Lattice Listener Rule. +--- + + + +# Resource: aws_vpclattice_listener_rule + +Terraform resource for managing an AWS VPC Lattice Listener Rule. + +## Example Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeListenerRule } from "./.gen/providers/aws/vpclattice-listener-rule"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeListenerRule(this, "test", { + action: { + forward: { + targetGroups: [ + { + targetGroupIdentifier: example.id, + weight: 1, + }, + { + targetGroupIdentifier: example2.id, + weight: 2, + }, + ], + }, + }, + listenerIdentifier: Token.asString( + awsVpclatticeListenerExample.listenerId + ), + match: { + httpMatch: { + headerMatches: [ + { + caseSensitive: false, + match: { + exact: "example-contains", + }, + name: "example-header", + }, + ], + pathMatch: { + caseSensitive: true, + match: { + prefix: "/example-path", + }, + }, + }, + }, + name: "example", + priority: 20, + serviceIdentifier: Token.asString(awsVpclatticeServiceExample.id), + }); + } +} + +``` + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeListenerRule } from "./.gen/providers/aws/vpclattice-listener-rule"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeListenerRule(this, "test", { + action: { + fixedResponse: { + statusCode: 404, + }, + }, + listenerIdentifier: example.listenerId, + match: { + httpMatch: { + pathMatch: { + caseSensitive: false, + match: { + exact: "/example-path", + }, + }, + }, + }, + name: "example", + priority: 10, + serviceIdentifier: Token.asString(awsVpclatticeServiceExample.id), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `serviceIdentifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service. +* `listenerIdentifier` - (Required) The ID or Amazon Resource Name (ARN) of the listener. +* `action` - (Required) The action for the default rule. +* `match` - (Required) The rule match. +* `name` - (Required) The name of the rule. The name must be unique within the listener. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen. +* `priority` - (Required) The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority. + +The following arguments are optional: + +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +action (`action`) supports the following: + +* `fixedResponse` - (Optional) Describes the rule action that returns a custom HTTP response. +* `forward` - (Optional) The forward action. Traffic that matches the rule is forwarded to the specified target groups. + +fixed response (`fixedResponse`) supports the following: + +* `statusCode` - (Optional) The HTTP response code. + +forward (`forward`) supports the following: + +* `targetGroups` - (Optional) The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic. + +The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group. + +action (`match`) supports the following: + +* `httpMatch` - (Optional) The HTTP criteria that a rule must match. + +http match (`httpMatch`) supports the following: + +* `headerMatches` - (Optional) The header matches. Matches incoming requests with rule based on request header value before applying rule action. +* `method` - (Optional) The HTTP method type. +* `pathMatch` - (Optional) The path match. + +header matches (`headerMatches`) supports the following: + +* `caseSensitive` - (Optional) Indicates whether the match is case sensitive. Defaults to false. +* `match` - (Optional) The header match type. +* `name` - (Optional) The name of the header. + +header matches match (`match`) supports the following: + +* `contains` - (Optional) Specifies a contains type match. +* `exact` - (Optional) Specifies an exact type match. +* `prefix` - (Optional) Specifies a prefix type match. Matches the value with the prefix. + +path match (`pathMatch`) supports the following: + +* `caseSensitive` - (Optional) Indicates whether the match is case sensitive. Defaults to false. +* `match` - (Optional) The header match type. + +path match match (`match`) supports the following: + +* `exact` - (Optional) Specifies an exact type match. +* `prefix` - (Optional) Specifies a prefix type match. Matches the value with the prefix. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the target group. +* `ruleId` - Unique identifier for the target group. +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `60M`) +* `update` - (Default `180M`) +* `delete` - (Default `90M`) + +## Import + +VPC Lattice Listener Rule can be imported using the `exampleIdArg`, e.g., + +``` +$ terraform import aws_vpclattice_listener_rule.example rft-8012925589 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_resource_policy.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_resource_policy.html.markdown new file mode 100644 index 00000000000..45178fe207b --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_resource_policy.html.markdown @@ -0,0 +1,99 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_resource_policy" +description: |- + Terraform resource for managing an AWS VPC Lattice Resource Policy. +--- + + + +# Resource: aws_vpclattice_resource_policy + +Terraform resource for managing an AWS VPC Lattice Resource Policy. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Fn, Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { DataAwsCallerIdentity } from "./.gen/providers/aws/data-aws-caller-identity"; +import { DataAwsPartition } from "./.gen/providers/aws/data-aws-partition"; +import { VpclatticeResourcePolicy } from "./.gen/providers/aws/vpclattice-resource-policy"; +import { VpclatticeServiceNetwork } from "./.gen/providers/aws/vpclattice-service-network"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + const example = new VpclatticeServiceNetwork(this, "example", { + name: "example-vpclattice-service-network", + }); + const current = new DataAwsCallerIdentity(this, "current", {}); + const dataAwsPartitionCurrent = new DataAwsPartition(this, "current_2", {}); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + dataAwsPartitionCurrent.overrideLogicalId("current"); + const awsVpclatticeResourcePolicyExample = new VpclatticeResourcePolicy( + this, + "example_3", + { + policy: Token.asString( + Fn.jsonencode({ + Statement: [ + { + Action: [ + "vpc-lattice:CreateServiceNetworkVpcAssociation", + "vpc-lattice:CreateServiceNetworkServiceAssociation", + "vpc-lattice:GetServiceNetwork", + ], + Effect: "Allow", + Principal: { + AWS: + "arn:${" + + dataAwsPartitionCurrent.partition + + "}:iam::${" + + current.accountId + + "}:root", + }, + Resource: example.arn, + Sid: "test-pol-principals-6", + }, + ], + Version: "2012-10-17", + }) + ), + resourceArn: example.arn, + } + ); + /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/ + awsVpclatticeResourcePolicyExample.overrideLogicalId("example"); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `resourceArn` - (Required) The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created. +* `policy` - (Required) An IAM policy. The policy string in JSON must not contain newlines or blank lines. + +## Attributes Reference + +No additional attributes are exported. + +## Import + +VPC Lattice Resource Policy can be imported using the `resourceArn`, e.g., + +``` +$ terraform import aws_vpclattice_resource_policy.example rft-8012925589 +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_service.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_service.html.markdown new file mode 100644 index 00000000000..821394b3c95 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_service.html.markdown @@ -0,0 +1,79 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service" +description: |- + Terraform resource for managing an AWS VPC Lattice Service. +--- + + + +# Resource: aws_vpclattice_service + +Terraform resource for managing an AWS VPC Lattice Service. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeService } from "./.gen/providers/aws/vpclattice-service"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeService(this, "example", { + authType: "AWS_IAM", + customDomainName: "example.com", + name: "example", + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `name` - (Required) Name of the service. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.Must be between 3 and 40 characters in length. + +The following arguments are optional: + +* `authType` - (Optional) Type of IAM policy. Either `none` or `awsIam`. +* `certificateArn` - (Optional) Amazon Resource Name (ARN) of the certificate. +* `customDomainName` - (Optional) Custom domain name of the service. +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the service. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information. +* `dnsEntry` - Concise description. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information. +* `id` - Unique identifier for the service. +* `status` - Status of the service. +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `5M`) +* `delete` - (Default `5M`) + +## Import + +VPC Lattice Service can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_service.example svc-06728e2357ea55f8a +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_service_network.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_service_network.html.markdown new file mode 100644 index 00000000000..d886ba6b479 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_service_network.html.markdown @@ -0,0 +1,66 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service_network" +description: |- + Terraform resource for managing an AWS VPC Lattice Service Network. +--- + + + +# Resource: aws_vpclattice_service_network + +Terraform resource for managing an AWS VPC Lattice Service Network. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeServiceNetwork } from "./.gen/providers/aws/vpclattice-service-network"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeServiceNetwork(this, "example", { + authType: "AWS_IAM", + name: "example", + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `name` - (Required) Name of the service network + +The following arguments are optional: + +* `authType` - (Optional) Type of IAM policy. Either `none` or `awsIam`. +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the Service Network. +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Import + +VPC Lattice Service Network can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_service_network.example sn-0158f91c1e3358dba +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_service_network_service_association.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_service_network_service_association.html.markdown new file mode 100644 index 00000000000..d13723b688e --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_service_network_service_association.html.markdown @@ -0,0 +1,81 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service_network_service_association" +description: |- + Terraform resource for managing an AWS VPC Lattice Service Network Service Association. +--- + + + +# Resource: aws_vpclattice_service_network_service_association + +Terraform resource for managing an AWS VPC Lattice Service Network Service Association. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeServiceNetworkServiceAssociation } from "./.gen/providers/aws/vpclattice-service-network-service-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeServiceNetworkServiceAssociation(this, "example", { + serviceIdentifier: Token.asString(awsVpclatticeServiceExample.id), + serviceNetworkIdentifier: Token.asString( + awsVpclatticeServiceNetworkExample.id + ), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `serviceIdentifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service. +* `serviceNetworkIdentifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. +The following arguments are optional: + +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The ARN of the Association. +* `createdBy` - The account that created the association. +* `customDomainName` - The custom domain name of the service. +* `dnsEntry` - The DNS name of the service. + * `domainName` - The domain name of the service. + * `hostedZoneId` - The ID of the hosted zone. +* `id` - The ID of the association. +* `status` - The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `5M`) +* `delete` - (Default `5M`) + +## Import + +VPC Lattice Service Network Service Association can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_service_network_service_association.example snsa-05e2474658a88f6ba +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_service_network_vpc_association.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_service_network_vpc_association.html.markdown new file mode 100644 index 00000000000..270df221fe4 --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_service_network_vpc_association.html.markdown @@ -0,0 +1,79 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_service_network_vpc_association" +description: |- + Terraform resource for managing an AWS VPC Lattice Service Network VPC Association. +--- + + + +# Resource: aws_vpclattice_service_network_vpc_association + +Terraform resource for managing an AWS VPC Lattice Service Network VPC Association. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeServiceNetworkVpcAssociation } from "./.gen/providers/aws/vpclattice-service-network-vpc-association"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeServiceNetworkVpcAssociation(this, "example", { + securityGroupIds: [Token.asString(awsSecurityGroupExample.id)], + serviceNetworkIdentifier: Token.asString( + awsVpclatticeServiceNetworkExample.id + ), + vpcIdentifier: Token.asString(awsVpcExample.id), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `vpcIdentifier` - (Required) The ID of the VPC. +* `serviceNetworkIdentifier` - (Required) The ID or Amazon Resource Identifier (ARN) of the service network. You must use the ARN if the resources specified in the operation are in different accounts. +The following arguments are optional: + +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. +* `securityGroupIds` - (Optional) The IDs of the security groups. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The ARN of the Association. +* `createdBy` - The account that created the association. +* `id` - The ID of the association. +* `status` - The operations status. Valid Values are CREATE_IN_PROGRESS | ACTIVE | DELETE_IN_PROGRESS | CREATE_FAILED | DELETE_FAILED +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `5M`) +* `delete` - (Default `5M`) + +## Import + +VPC Lattice Service Network VPC Association can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_service_network_vpc_association.example snsa-05e2474658a88f6ba +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_target_group.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_target_group.html.markdown new file mode 100644 index 00000000000..8de2a16340e --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_target_group.html.markdown @@ -0,0 +1,172 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_target_group" +description: |- + Terraform resource for managing an AWS VPC Lattice Target Group. +--- + + + +# Resource: aws_vpclattice_target_group + +Terraform resource for managing an AWS VPC Lattice Target Group. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeTargetGroup } from "./.gen/providers/aws/vpclattice-target-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeTargetGroup(this, "example", { + config: { + port: 443, + protocol: "HTTPS", + vpcIdentifier: Token.asString(awsVpcExample.id), + }, + name: "example", + type: "INSTANCE", + }); + } +} + +``` + +### Basic usage with Health check + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeTargetGroup } from "./.gen/providers/aws/vpclattice-target-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeTargetGroup(this, "example", { + config: { + healthCheck: { + enabled: true, + healthCheckIntervalSeconds: 20, + healthCheckTimeoutSeconds: 10, + healthyThresholdCount: 7, + matcher: { + value: "200-299", + }, + path: "/instance", + port: 80, + protocol: "HTTP", + protocolVersion: "HTTP1", + unhealthyThresholdCount: 3, + }, + port: 443, + protocol: "HTTPS", + protocolVersion: "HTTP1", + vpcIdentifier: Token.asString(awsVpcExample.id), + }, + name: "example", + type: "ALB", + }); + } +} + +``` + +### Lambda + +If the type is Lambda, `config` block is not supported. + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeTargetGroup } from "./.gen/providers/aws/vpclattice-target-group"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeTargetGroup(this, "example", { + name: "example", + type: "LAMBDA", + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `name` - (Required) The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen. +* `type` - (Required) The type of target group. Valid Values are `ip` | `lambda` | `instance` | `alb` + +The following arguments are optional: + +* `config` - (Optional) The target group configuration. If type is set to `lambda,` this parameter should not be specified. +* `tags` - (Optional) Key-value mapping of resource tags. If configured with a provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +Config (`config`) supports the following: + +* `healthCheck` - (Optional) The health check configuration. +* `ipAddressType` - (Optional) The type of IP address used for the target group. Valid values: `ipv4` | `ipv6` +* `port` - (Required) The port on which the targets are listening. +* `protocol` - (Required) The protocol to use for routing traffic to the targets. Valid Values are `http` | `https` +* `protocolVersion` - (Optional) The protocol version. Valid Values are `http1` | `http2` | `grpc`. Default value is `http1`. +* `vpcIdentifier` - (Required) The ID of the VPC. + +Health Check (`healthCheck`) supports the following: + +* `enabled` - (Optional) Indicates whether health checking is enabled. Defaults to `true`. +* `healthCheckIntervalSeconds` - (Optional) The approximate amount of time, in seconds, between health checks of an individual target. The range is 5–300 seconds. The default is 30 seconds. +* `healthCheckTimeoutSeconds` - (Optional) The amount of time, in seconds, to wait before reporting a target as unhealthy. The range is 1–120 seconds. The default is 5 seconds. +* `healthy_threshold_count ` - (Optional) The number of consecutive successful health checks required before considering an unhealthy target healthy. The range is 2–10. The default is 5. +* `matcher` - (Optional) The codes to use when checking for a successful response from a target. These are called _Success codes_ in the console. + * `value` - (Optional) The HTTP codes to use when checking for a successful response from a target. +* `path` - (Optional) The destination for health checks on the targets. If the protocol version is HTTP/1.1 or HTTP/2, specify a valid URI (for example, /path?query). The default path is `/`. Health checks are not supported if the protocol version is gRPC, however, you can choose HTTP/1.1 or HTTP/2 and specify a valid URI. +* `port` - (Optional) The port used when performing health checks on targets. The default setting is the port that a target receives traffic on. +* `protocol` - (Optional) The protocol used when performing health checks on targets. The possible protocols are `http` and `https`. +* `protocolVersion` - (Optional) The protocol version used when performing health checks on targets. The possible protocol versions are `http1` and `http2`. The default is `http1`. +* `unhealthyThresholdCount` - (Optional) The number of consecutive failed health checks required before considering a target unhealthy. The range is 2–10. The default is 2. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the target group. +* `id` - Unique identifier for the target group. +* `status` - Status of the target group. +* `tagsAll` - Map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block). + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `5M`) +* `delete` - (Default `5M`) + +## Import + +VPC Lattice Target Group can be imported using the `id`, e.g., + +``` +$ terraform import aws_vpclattice_target_group.example tg-0c11d4dc16ed96bdb +``` + + \ No newline at end of file diff --git a/website/docs/cdktf/typescript/r/vpclattice_target_group_attachment.html.markdown b/website/docs/cdktf/typescript/r/vpclattice_target_group_attachment.html.markdown new file mode 100644 index 00000000000..a5fa7a9768e --- /dev/null +++ b/website/docs/cdktf/typescript/r/vpclattice_target_group_attachment.html.markdown @@ -0,0 +1,59 @@ +--- +subcategory: "VPC Lattice" +layout: "aws" +page_title: "AWS: aws_vpclattice_target_group_attachment" +description: |- + Provides the ability to register a target with an AWS VPC Lattice Target Group. +--- + + + +# Resource: aws_vpclattice_target_group_attachment + +Provides the ability to register a target with an AWS VPC Lattice Target Group. + +## Example Usage + +### Basic Usage + +```typescript +// Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug +import { Construct } from "constructs"; +import { Token, TerraformStack } from "cdktf"; +/* + * Provider bindings are generated by running `cdktf get`. + * See https://cdk.tf/provider-generation for more details. + */ +import { VpclatticeTargetGroupAttachment } from "./.gen/providers/aws/vpclattice-target-group-attachment"; +class MyConvertedCode extends TerraformStack { + constructor(scope: Construct, name: string) { + super(scope, name); + new VpclatticeTargetGroupAttachment(this, "example", { + target: { + id: Token.asString(awsLbExample.arn), + port: 80, + }, + targetGroupIdentifier: Token.asString(awsVpclatticeTargetGroupExample.id), + }); + } +} + +``` + +## Argument Reference + +The following arguments are required: + +- `targetGroupIdentifier` - (Required) The ID or Amazon Resource Name (ARN) of the target group. +- `target` - (Required) The target. + +`target` supports the following: + +- `id` - (Required) The ID of the target. If the target type of the target group is INSTANCE, this is an instance ID. If the target type is IP , this is an IP address. If the target type is LAMBDA, this is the ARN of the Lambda function. If the target type is ALB, this is the ARN of the Application Load Balancer. +- `port` - (Optional) The port on which the target is listening. For HTTP, the default is 80. For HTTPS, the default is 443. + +## Attributes Reference + +No additional attributes are exported. + + \ No newline at end of file