diff --git a/.changelog/42591.txt b/.changelog/42591.txt new file mode 100644 index 000000000000..a844054f93d5 --- /dev/null +++ b/.changelog/42591.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +aws_nat_gateway_eip_association +``` diff --git a/internal/service/ec2/exports_test.go b/internal/service/ec2/exports_test.go index b2fab0a82d92..00333b18a1dd 100644 --- a/internal/service/ec2/exports_test.go +++ b/internal/service/ec2/exports_test.go @@ -55,6 +55,7 @@ var ( ResourceManagedPrefixList = resourceManagedPrefixList ResourceManagedPrefixListEntry = resourceManagedPrefixListEntry ResourceNATGateway = resourceNATGateway + ResourceNATGatewayEIPAssociation = newResourceNATGatewayEIPAssociation ResourceNetworkACL = resourceNetworkACL ResourceNetworkACLAssociation = resourceNetworkACLAssociation ResourceNetworkACLRule = resourceNetworkACLRule @@ -127,163 +128,164 @@ var ( ResourceVerifiedAccessTrustProvider = resourceVerifiedAccessTrustProvider ResourceVolumeAttachment = resourceVolumeAttachment - CheckMostRecentAndMissingFilters = checkMostRecentAndMissingFilters - CustomFiltersSchema = customFiltersSchema - CustomerGatewayConfigurationToTunnelInfo = customerGatewayConfigurationToTunnelInfo - ErrCodeDefaultSubnetAlreadyExistsInAvailabilityZone = errCodeDefaultSubnetAlreadyExistsInAvailabilityZone - ErrCodeInvalidSpotDatafeedNotFound = errCodeInvalidSpotDatafeedNotFound - ExpandIPPerms = expandIPPerms - FindAvailabilityZones = findAvailabilityZones - FindCapacityReservationByID = findCapacityReservationByID - FindCarrierGatewayByID = findCarrierGatewayByID - FindClientVPNAuthorizationRuleByThreePartKey = findClientVPNAuthorizationRuleByThreePartKey - FindClientVPNEndpointByID = findClientVPNEndpointByID - FindClientVPNNetworkAssociationByTwoPartKey = findClientVPNNetworkAssociationByTwoPartKey - FindClientVPNRouteByThreePartKey = findClientVPNRouteByThreePartKey - FindCreateSnapshotCreateVolumePermissionByTwoPartKey = findCreateSnapshotCreateVolumePermissionByTwoPartKey - FindCustomerGatewayByID = findCustomerGatewayByID - FindDefaultCreditSpecificationByInstanceFamily = findDefaultCreditSpecificationByInstanceFamily - FindDHCPOptionsByID = findDHCPOptionsByID - FindEBSVolumeAttachment = findVolumeAttachment - FindEBSVolumeByID = findEBSVolumeByID - FindEIPByAllocationID = findEIPByAllocationID - FindEIPByAssociationID = findEIPByAssociationID - FindEIPDomainNameAttributeByAllocationID = findEIPDomainNameAttributeByAllocationID - FindEgressOnlyInternetGatewayByID = findEgressOnlyInternetGatewayByID - FindFastSnapshotRestoreByTwoPartKey = findFastSnapshotRestoreByTwoPartKey - FindFleetByID = findFleetByID - FindFlowLogByID = findFlowLogByID - FindHostByID = findHostByID - FindIPAMByID = findIPAMByID - FindIPAMPoolAllocationByTwoPartKey = findIPAMPoolAllocationByTwoPartKey - FindIPAMPoolAllocationsForVPC = findIPAMPoolAllocationsForVPC - FindIPAMPoolByID = findIPAMPoolByID - FindIPAMPoolCIDRByTwoPartKey = findIPAMPoolCIDRByTwoPartKey - FindIPAMResourceDiscoveryAssociationByID = findIPAMResourceDiscoveryAssociationByID - FindIPAMResourceDiscoveryByID = findIPAMResourceDiscoveryByID - FindIPAMScopeByID = findIPAMScopeByID - FindImageLaunchPermission = findImageLaunchPermission - FindInstanceConnectEndpointByID = findInstanceConnectEndpointByID - FindInstanceMetadataDefaults = findInstanceMetadataDefaults - FindInstanceStateByID = findInstanceStateByID - FindInternetGateway = findInternetGateway - FindInternetGatewayAttachment = findInternetGatewayAttachment - FindInternetGatewayByID = findInternetGatewayByID - FindKeyPairByName = findKeyPairByName - FindLaunchTemplateByID = findLaunchTemplateByID - FindLocalGatewayRouteByTwoPartKey = findLocalGatewayRouteByTwoPartKey - FindLocalGatewayRouteTableVPCAssociationByID = findLocalGatewayRouteTableVPCAssociationByID - FindMainRouteTableAssociationByID = findMainRouteTableAssociationByID - FindManagedPrefixListByID = findManagedPrefixListByID - FindManagedPrefixListEntryByIDAndCIDR = findManagedPrefixListEntryByIDAndCIDR - FindNATGatewayByID = findNATGatewayByID - FindNetworkACLAssociationByID = findNetworkACLAssociationByID - FindNetworkACLByID = findNetworkACLByID - FindNetworkACLEntryByThreePartKey = findNetworkACLEntryByThreePartKey - FindNetworkInsightsAnalysisByID = findNetworkInsightsAnalysisByID - FindNetworkInsightsPathByID = findNetworkInsightsPathByID - FindNetworkInterfaceByID = findNetworkInterfaceByID - FindNetworkInterfacePermissionByID = findNetworkInterfacePermissionByID - FindNetworkInterfaceSecurityGroup = findNetworkInterfaceSecurityGroup - FindNetworkPerformanceMetricSubscriptionByFourPartKey = findNetworkPerformanceMetricSubscriptionByFourPartKey - FindPlacementGroupByName = findPlacementGroupByName - FindPublicIPv4Pools = findPublicIPv4Pools - FindRouteByIPv4Destination = findRouteByIPv4Destination - FindRouteByIPv6Destination = findRouteByIPv6Destination - FindRouteByPrefixListIDDestination = findRouteByPrefixListIDDestination - FindRouteTableAssociationByID = findRouteTableAssociationByID - FindRouteTableByID = findRouteTableByID - FindSecurityGroupByID = findSecurityGroupByID - FindSecurityGroupEgressRuleByID = findSecurityGroupEgressRuleByID - FindSecurityGroupIngressRuleByID = findSecurityGroupIngressRuleByID - FindSnapshot = findSnapshot - FindSnapshotByID = findSnapshotByID - FindSpotDatafeedSubscription = findSpotDatafeedSubscription - FindSpotFleetRequestByID = findSpotFleetRequestByID - FindSpotFleetRequests = findSpotFleetRequests - FindSpotInstanceRequestByID = findSpotInstanceRequestByID - FindSubnetCIDRReservationBySubnetIDAndReservationID = findSubnetCIDRReservationBySubnetIDAndReservationID - FindSubnets = findSubnets - FindTag = findTag - FindTrafficMirrorFilterByID = findTrafficMirrorFilterByID - FindTrafficMirrorFilterRuleByTwoPartKey = findTrafficMirrorFilterRuleByTwoPartKey - FindTrafficMirrorSessionByID = findTrafficMirrorSessionByID - FindTrafficMirrorTargetByID = findTrafficMirrorTargetByID - FindTransitGatewayByID = findTransitGatewayByID - FindTransitGatewayConnectByID = findTransitGatewayConnectByID - FindTransitGatewayConnectPeerByID = findTransitGatewayConnectPeerByID - FindTransitGatewayMulticastDomainAssociationByThreePartKey = findTransitGatewayMulticastDomainAssociationByThreePartKey - FindTransitGatewayMulticastDomainByID = findTransitGatewayMulticastDomainByID - FindTransitGatewayMulticastGroupMemberByThreePartKey = findTransitGatewayMulticastGroupMemberByThreePartKey - FindTransitGatewayMulticastGroupSourceByThreePartKey = findTransitGatewayMulticastGroupSourceByThreePartKey - FindTransitGatewayPeeringAttachmentByID = findTransitGatewayPeeringAttachmentByID - FindTransitGatewayPolicyTableAssociationByTwoPartKey = findTransitGatewayPolicyTableAssociationByTwoPartKey - FindTransitGatewayPolicyTableByID = findTransitGatewayPolicyTableByID - FindTransitGatewayPrefixListReferenceByTwoPartKey = findTransitGatewayPrefixListReferenceByTwoPartKey - FindTransitGatewayRouteTableAssociationByTwoPartKey = findTransitGatewayRouteTableAssociationByTwoPartKey - FindTransitGatewayRouteTableByID = findTransitGatewayRouteTableByID - FindTransitGatewayRouteTablePropagationByTwoPartKey = findTransitGatewayRouteTablePropagationByTwoPartKey - FindTransitGatewayStaticRoute = findTransitGatewayStaticRoute - FindTransitGatewayVPCAttachmentByID = findTransitGatewayVPCAttachmentByID - FindVPCBlockPublicAccessExclusionByID = findVPCBlockPublicAccessExclusionByID - FindVPCCIDRBlockAssociationByID = findVPCCIDRBlockAssociationByID - FindVPCDHCPOptionsAssociation = findVPCDHCPOptionsAssociation - FindVPCEndpointConnectionByServiceIDAndVPCEndpointID = findVPCEndpointConnectionByServiceIDAndVPCEndpointID - FindVPCEndpointConnectionNotificationByID = findVPCEndpointConnectionNotificationByID - FindVPCEndpointRouteTableAssociationExists = findVPCEndpointRouteTableAssociationExists - FindVPCEndpointSecurityGroupAssociationExists = findVPCEndpointSecurityGroupAssociationExists - FindVPCEndpointServiceConfigurationByID = findVPCEndpointServiceConfigurationByID - FindVPCEndpointServicePermission = findVPCEndpointServicePermission - FindVPCEndpointSubnetAssociationExists = findVPCEndpointSubnetAssociationExists - FindVPCIPv6CIDRBlockAssociationByID = findVPCIPv6CIDRBlockAssociationByID - FindVPCPeeringConnectionByID = findVPCPeeringConnectionByID - FindVPNConnectionByID = findVPNConnectionByID - FindVPNConnectionRouteByTwoPartKey = findVPNConnectionRouteByTwoPartKey - FindVPNGatewayByID = findVPNGatewayByID - FindVPNGatewayRoutePropagationExists = findVPNGatewayRoutePropagationExists - FindVPNGatewayVPCAttachmentByTwoPartKey = findVPNGatewayVPCAttachmentByTwoPartKey - FindVerifiedAccessEndpointByID = findVerifiedAccessEndpointByID - FindVerifiedAccessGroupByID = findVerifiedAccessGroupByID - FindVerifiedAccessInstanceByID = findVerifiedAccessInstanceByID - FindVerifiedAccessInstanceLoggingConfigurationByInstanceID = findVerifiedAccessInstanceLoggingConfigurationByInstanceID - FindVerifiedAccessInstanceTrustProviderAttachmentExists = findVerifiedAccessInstanceTrustProviderAttachmentExists - FindVerifiedAccessTrustProviderByID = findVerifiedAccessTrustProviderByID - FindVolumeAttachmentInstanceByID = findVolumeAttachmentInstanceByID - FlattenNetworkInterfacePrivateIPAddresses = flattenNetworkInterfacePrivateIPAddresses - FlattenSecurityGroups = flattenSecurityGroups - IPAMServicePrincipal = ipamServicePrincipal - InstanceMigrateState = instanceMigrateState - InternetGatewayAttachmentParseResourceID = internetGatewayAttachmentParseResourceID - KeyPairMigrateState = keyPairMigrateState - ManagedPrefixListEntryCreateResourceID = managedPrefixListEntryCreateResourceID - ManagedPrefixListEntryParseResourceID = managedPrefixListEntryParseResourceID - MatchRules = matchRules - NetworkACLRuleImportIDSeparator = networkACLRuleImportIDSeparator - NewAttributeFilterList = newAttributeFilterList - NewCustomFilterList = newCustomFilterList - NewTagFilterList = newTagFilterList - OpenSSHPublicKeysEqual = openSSHPublicKeysEqual - ParseInstanceType = parseInstanceType - ProtocolForValue = protocolForValue - ProtocolStateFunc = protocolStateFunc - SecurityGroupCollapseRules = securityGroupCollapseRules - SecurityGroupExpandRules = securityGroupExpandRules - SecurityGroupIPPermGather = securityGroupIPPermGather - SecurityGroupMigrateState = securityGroupMigrateState - SecurityGroupRuleCreateID = securityGroupRuleCreateID - SecurityGroupRuleHash = securityGroupRuleHash - SecurityGroupRuleMigrateState = securityGroupRuleMigrateState - SpotFleetRequestMigrateState = spotFleetRequestMigrateState - StopEBSVolumeAttachmentInstance = stopVolumeAttachmentInstance - StopInstance = stopInstance - SubnetMigrateState = subnetMigrateState - UnsuccessfulItemError = unsuccessfulItemError - UnsuccessfulItemsError = unsuccessfulItemsError - UpdateTags = updateTags - VPCDHCPOptionsAssociationParseResourceID = vpcDHCPOptionsAssociationParseResourceID - VPCMigrateState = vpcMigrateState - VPNGatewayRoutePropagationParseID = vpnGatewayRoutePropagationParseID - WaitVolumeAttachmentCreated = waitVolumeAttachmentCreated + CheckMostRecentAndMissingFilters = checkMostRecentAndMissingFilters + CustomFiltersSchema = customFiltersSchema + CustomerGatewayConfigurationToTunnelInfo = customerGatewayConfigurationToTunnelInfo + ErrCodeDefaultSubnetAlreadyExistsInAvailabilityZone = errCodeDefaultSubnetAlreadyExistsInAvailabilityZone + ErrCodeInvalidSpotDatafeedNotFound = errCodeInvalidSpotDatafeedNotFound + ExpandIPPerms = expandIPPerms + FindAvailabilityZones = findAvailabilityZones + FindCapacityReservationByID = findCapacityReservationByID + FindCarrierGatewayByID = findCarrierGatewayByID + FindClientVPNAuthorizationRuleByThreePartKey = findClientVPNAuthorizationRuleByThreePartKey + FindClientVPNEndpointByID = findClientVPNEndpointByID + FindClientVPNNetworkAssociationByTwoPartKey = findClientVPNNetworkAssociationByTwoPartKey + FindClientVPNRouteByThreePartKey = findClientVPNRouteByThreePartKey + FindCreateSnapshotCreateVolumePermissionByTwoPartKey = findCreateSnapshotCreateVolumePermissionByTwoPartKey + FindCustomerGatewayByID = findCustomerGatewayByID + FindDefaultCreditSpecificationByInstanceFamily = findDefaultCreditSpecificationByInstanceFamily + FindDHCPOptionsByID = findDHCPOptionsByID + FindEBSVolumeAttachment = findVolumeAttachment + FindEBSVolumeByID = findEBSVolumeByID + FindEIPByAllocationID = findEIPByAllocationID + FindEIPByAssociationID = findEIPByAssociationID + FindEIPDomainNameAttributeByAllocationID = findEIPDomainNameAttributeByAllocationID + FindEgressOnlyInternetGatewayByID = findEgressOnlyInternetGatewayByID + FindFastSnapshotRestoreByTwoPartKey = findFastSnapshotRestoreByTwoPartKey + FindFleetByID = findFleetByID + FindFlowLogByID = findFlowLogByID + FindHostByID = findHostByID + FindIPAMByID = findIPAMByID + FindIPAMPoolAllocationByTwoPartKey = findIPAMPoolAllocationByTwoPartKey + FindIPAMPoolAllocationsForVPC = findIPAMPoolAllocationsForVPC + FindIPAMPoolByID = findIPAMPoolByID + FindIPAMPoolCIDRByTwoPartKey = findIPAMPoolCIDRByTwoPartKey + FindIPAMResourceDiscoveryAssociationByID = findIPAMResourceDiscoveryAssociationByID + FindIPAMResourceDiscoveryByID = findIPAMResourceDiscoveryByID + FindIPAMScopeByID = findIPAMScopeByID + FindImageLaunchPermission = findImageLaunchPermission + FindInstanceConnectEndpointByID = findInstanceConnectEndpointByID + FindInstanceMetadataDefaults = findInstanceMetadataDefaults + FindInstanceStateByID = findInstanceStateByID + FindInternetGateway = findInternetGateway + FindInternetGatewayAttachment = findInternetGatewayAttachment + FindInternetGatewayByID = findInternetGatewayByID + FindKeyPairByName = findKeyPairByName + FindLaunchTemplateByID = findLaunchTemplateByID + FindLocalGatewayRouteByTwoPartKey = findLocalGatewayRouteByTwoPartKey + FindLocalGatewayRouteTableVPCAssociationByID = findLocalGatewayRouteTableVPCAssociationByID + FindMainRouteTableAssociationByID = findMainRouteTableAssociationByID + FindManagedPrefixListByID = findManagedPrefixListByID + FindManagedPrefixListEntryByIDAndCIDR = findManagedPrefixListEntryByIDAndCIDR + FindNATGatewayByID = findNATGatewayByID + FindNATGatewayAddressByNATGatewayIDAndAllocationIDSucceeded = findNATGatewayAddressByNATGatewayIDAndAllocationIDSucceeded + FindNetworkACLAssociationByID = findNetworkACLAssociationByID + FindNetworkACLByID = findNetworkACLByID + FindNetworkACLEntryByThreePartKey = findNetworkACLEntryByThreePartKey + FindNetworkInsightsAnalysisByID = findNetworkInsightsAnalysisByID + FindNetworkInsightsPathByID = findNetworkInsightsPathByID + FindNetworkInterfaceByID = findNetworkInterfaceByID + FindNetworkInterfacePermissionByID = findNetworkInterfacePermissionByID + FindNetworkInterfaceSecurityGroup = findNetworkInterfaceSecurityGroup + FindNetworkPerformanceMetricSubscriptionByFourPartKey = findNetworkPerformanceMetricSubscriptionByFourPartKey + FindPlacementGroupByName = findPlacementGroupByName + FindPublicIPv4Pools = findPublicIPv4Pools + FindRouteByIPv4Destination = findRouteByIPv4Destination + FindRouteByIPv6Destination = findRouteByIPv6Destination + FindRouteByPrefixListIDDestination = findRouteByPrefixListIDDestination + FindRouteTableAssociationByID = findRouteTableAssociationByID + FindRouteTableByID = findRouteTableByID + FindSecurityGroupByID = findSecurityGroupByID + FindSecurityGroupEgressRuleByID = findSecurityGroupEgressRuleByID + FindSecurityGroupIngressRuleByID = findSecurityGroupIngressRuleByID + FindSnapshot = findSnapshot + FindSnapshotByID = findSnapshotByID + FindSpotDatafeedSubscription = findSpotDatafeedSubscription + FindSpotFleetRequestByID = findSpotFleetRequestByID + FindSpotFleetRequests = findSpotFleetRequests + FindSpotInstanceRequestByID = findSpotInstanceRequestByID + FindSubnetCIDRReservationBySubnetIDAndReservationID = findSubnetCIDRReservationBySubnetIDAndReservationID + FindSubnets = findSubnets + FindTag = findTag + FindTrafficMirrorFilterByID = findTrafficMirrorFilterByID + FindTrafficMirrorFilterRuleByTwoPartKey = findTrafficMirrorFilterRuleByTwoPartKey + FindTrafficMirrorSessionByID = findTrafficMirrorSessionByID + FindTrafficMirrorTargetByID = findTrafficMirrorTargetByID + FindTransitGatewayByID = findTransitGatewayByID + FindTransitGatewayConnectByID = findTransitGatewayConnectByID + FindTransitGatewayConnectPeerByID = findTransitGatewayConnectPeerByID + FindTransitGatewayMulticastDomainAssociationByThreePartKey = findTransitGatewayMulticastDomainAssociationByThreePartKey + FindTransitGatewayMulticastDomainByID = findTransitGatewayMulticastDomainByID + FindTransitGatewayMulticastGroupMemberByThreePartKey = findTransitGatewayMulticastGroupMemberByThreePartKey + FindTransitGatewayMulticastGroupSourceByThreePartKey = findTransitGatewayMulticastGroupSourceByThreePartKey + FindTransitGatewayPeeringAttachmentByID = findTransitGatewayPeeringAttachmentByID + FindTransitGatewayPolicyTableAssociationByTwoPartKey = findTransitGatewayPolicyTableAssociationByTwoPartKey + FindTransitGatewayPolicyTableByID = findTransitGatewayPolicyTableByID + FindTransitGatewayPrefixListReferenceByTwoPartKey = findTransitGatewayPrefixListReferenceByTwoPartKey + FindTransitGatewayRouteTableAssociationByTwoPartKey = findTransitGatewayRouteTableAssociationByTwoPartKey + FindTransitGatewayRouteTableByID = findTransitGatewayRouteTableByID + FindTransitGatewayRouteTablePropagationByTwoPartKey = findTransitGatewayRouteTablePropagationByTwoPartKey + FindTransitGatewayStaticRoute = findTransitGatewayStaticRoute + FindTransitGatewayVPCAttachmentByID = findTransitGatewayVPCAttachmentByID + FindVPCBlockPublicAccessExclusionByID = findVPCBlockPublicAccessExclusionByID + FindVPCCIDRBlockAssociationByID = findVPCCIDRBlockAssociationByID + FindVPCDHCPOptionsAssociation = findVPCDHCPOptionsAssociation + FindVPCEndpointConnectionByServiceIDAndVPCEndpointID = findVPCEndpointConnectionByServiceIDAndVPCEndpointID + FindVPCEndpointConnectionNotificationByID = findVPCEndpointConnectionNotificationByID + FindVPCEndpointRouteTableAssociationExists = findVPCEndpointRouteTableAssociationExists + FindVPCEndpointSecurityGroupAssociationExists = findVPCEndpointSecurityGroupAssociationExists + FindVPCEndpointServiceConfigurationByID = findVPCEndpointServiceConfigurationByID + FindVPCEndpointServicePermission = findVPCEndpointServicePermission + FindVPCEndpointSubnetAssociationExists = findVPCEndpointSubnetAssociationExists + FindVPCIPv6CIDRBlockAssociationByID = findVPCIPv6CIDRBlockAssociationByID + FindVPCPeeringConnectionByID = findVPCPeeringConnectionByID + FindVPNConnectionByID = findVPNConnectionByID + FindVPNConnectionRouteByTwoPartKey = findVPNConnectionRouteByTwoPartKey + FindVPNGatewayByID = findVPNGatewayByID + FindVPNGatewayRoutePropagationExists = findVPNGatewayRoutePropagationExists + FindVPNGatewayVPCAttachmentByTwoPartKey = findVPNGatewayVPCAttachmentByTwoPartKey + FindVerifiedAccessEndpointByID = findVerifiedAccessEndpointByID + FindVerifiedAccessGroupByID = findVerifiedAccessGroupByID + FindVerifiedAccessInstanceByID = findVerifiedAccessInstanceByID + FindVerifiedAccessInstanceLoggingConfigurationByInstanceID = findVerifiedAccessInstanceLoggingConfigurationByInstanceID + FindVerifiedAccessInstanceTrustProviderAttachmentExists = findVerifiedAccessInstanceTrustProviderAttachmentExists + FindVerifiedAccessTrustProviderByID = findVerifiedAccessTrustProviderByID + FindVolumeAttachmentInstanceByID = findVolumeAttachmentInstanceByID + FlattenNetworkInterfacePrivateIPAddresses = flattenNetworkInterfacePrivateIPAddresses + FlattenSecurityGroups = flattenSecurityGroups + IPAMServicePrincipal = ipamServicePrincipal + InstanceMigrateState = instanceMigrateState + InternetGatewayAttachmentParseResourceID = internetGatewayAttachmentParseResourceID + KeyPairMigrateState = keyPairMigrateState + ManagedPrefixListEntryCreateResourceID = managedPrefixListEntryCreateResourceID + ManagedPrefixListEntryParseResourceID = managedPrefixListEntryParseResourceID + MatchRules = matchRules + NetworkACLRuleImportIDSeparator = networkACLRuleImportIDSeparator + NewAttributeFilterList = newAttributeFilterList + NewCustomFilterList = newCustomFilterList + NewTagFilterList = newTagFilterList + OpenSSHPublicKeysEqual = openSSHPublicKeysEqual + ParseInstanceType = parseInstanceType + ProtocolForValue = protocolForValue + ProtocolStateFunc = protocolStateFunc + SecurityGroupCollapseRules = securityGroupCollapseRules + SecurityGroupExpandRules = securityGroupExpandRules + SecurityGroupIPPermGather = securityGroupIPPermGather + SecurityGroupMigrateState = securityGroupMigrateState + SecurityGroupRuleCreateID = securityGroupRuleCreateID + SecurityGroupRuleHash = securityGroupRuleHash + SecurityGroupRuleMigrateState = securityGroupRuleMigrateState + SpotFleetRequestMigrateState = spotFleetRequestMigrateState + StopEBSVolumeAttachmentInstance = stopVolumeAttachmentInstance + StopInstance = stopInstance + SubnetMigrateState = subnetMigrateState + UnsuccessfulItemError = unsuccessfulItemError + UnsuccessfulItemsError = unsuccessfulItemsError + UpdateTags = updateTags + VPCDHCPOptionsAssociationParseResourceID = vpcDHCPOptionsAssociationParseResourceID + VPCMigrateState = vpcMigrateState + VPNGatewayRoutePropagationParseID = vpnGatewayRoutePropagationParseID + WaitVolumeAttachmentCreated = waitVolumeAttachmentCreated ) type ( diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index 8491156c9ed1..ccaca39d9bf9 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -1704,6 +1704,22 @@ func findNATGatewayAddressByNATGatewayIDAndAllocationID(ctx context.Context, con })) } +func findNATGatewayAddressByNATGatewayIDAndAllocationIDSucceeded(ctx context.Context, conn *ec2.Client, natGatewayID, allocationID string) (*awstypes.NatGatewayAddress, error) { + output, err := findNATGatewayAddressByNATGatewayIDAndAllocationID(ctx, conn, natGatewayID, allocationID) + + if err != nil { + return nil, err + } + + if output.Status != awstypes.NatGatewayAddressStatusSucceeded { + return nil, &retry.NotFoundError{ + Message: string(output.Status), + } + } + + return output, nil +} + func findNATGatewayAddressByNATGatewayIDAndPrivateIP(ctx context.Context, conn *ec2.Client, natGatewayID, privateIP string) (*awstypes.NatGatewayAddress, error) { output, err := findNATGatewayByID(ctx, conn, natGatewayID) diff --git a/internal/service/ec2/service_package_gen.go b/internal/service/ec2/service_package_gen.go index 5dc60ae2bea4..8612f004b00b 100644 --- a/internal/service/ec2/service_package_gen.go +++ b/internal/service/ec2/service_package_gen.go @@ -103,6 +103,11 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.Servic TypeName: "aws_eip_domain_name", Name: "EIP Domain Name", }, + { + Factory: newResourceNATGatewayEIPAssociation, + TypeName: "aws_nat_gateway_eip_association", + Name: "VPC NAT Gateway EIP Association", + }, { Factory: newNetworkInterfacePermissionResource, TypeName: "aws_network_interface_permission", diff --git a/internal/service/ec2/vpc_nat_gateway.go b/internal/service/ec2/vpc_nat_gateway.go index 5e0b542b81eb..ad4033049720 100644 --- a/internal/service/ec2/vpc_nat_gateway.go +++ b/internal/service/ec2/vpc_nat_gateway.go @@ -82,6 +82,7 @@ func resourceNATGateway() *schema.Resource { "secondary_allocation_ids": { Type: schema.TypeSet, Optional: true, + Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "secondary_private_ip_address_count": { @@ -258,7 +259,7 @@ func resourceNATGatewayUpdate(ctx context.Context, d *schema.ResourceData, meta } } case awstypes.ConnectivityTypePublic: - if d.HasChanges("secondary_allocation_ids") { + if !d.GetRawConfig().GetAttr("secondary_allocation_ids").IsNull() && d.HasChanges("secondary_allocation_ids") { o, n := d.GetChange("secondary_allocation_ids") os, ns := o.(*schema.Set), n.(*schema.Set) diff --git a/internal/service/ec2/vpc_nat_gateway_eip_association.go b/internal/service/ec2/vpc_nat_gateway_eip_association.go new file mode 100644 index 000000000000..bc966864d5a7 --- /dev/null +++ b/internal/service/ec2/vpc_nat_gateway_eip_association.go @@ -0,0 +1,241 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package ec2 + +import ( + "context" + "time" + + "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/hashicorp/aws-sdk-go-base/v2/tfawserr" + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag" + fwflex "github.com/hashicorp/terraform-provider-aws/internal/flex" + "github.com/hashicorp/terraform-provider-aws/internal/framework" + "github.com/hashicorp/terraform-provider-aws/internal/framework/flex" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +// Function annotations are used for resource registration to the Provider. DO NOT EDIT. +// @FrameworkResource("aws_nat_gateway_eip_association", name="VPC NAT Gateway EIP Association") +func newResourceNATGatewayEIPAssociation(_ context.Context) (resource.ResourceWithConfigure, error) { + r := &resourceNATGatewayEIPAssociation{} + + r.SetDefaultCreateTimeout(10 * time.Minute) + r.SetDefaultUpdateTimeout(10 * time.Minute) + r.SetDefaultDeleteTimeout(30 * time.Minute) + + return r, nil +} + +const ( + ResNameVPCNATGatewayEIPAssociation = "VPC NAT Gateway EIP Association" +) + +type resourceNATGatewayEIPAssociation struct { + framework.ResourceWithConfigure + framework.WithTimeouts +} + +func (r *resourceNATGatewayEIPAssociation) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "allocation_id": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + names.AttrAssociationID: schema.StringAttribute{ + Computed: true, + }, + names.AttrID: framework.IDAttribute(), + "nat_gateway_id": schema.StringAttribute{ + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + }, + Blocks: map[string]schema.Block{ + names.AttrTimeouts: timeouts.Block(ctx, timeouts.Opts{ + Create: true, + Update: true, + Delete: true, + }), + }, + } +} + +func (r *resourceNATGatewayEIPAssociation) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + conn := r.Meta().EC2Client(ctx) + + var plan resourceVPCNATGatewayEIPAssociationModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + id, err := plan.setID() + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.EC2, create.ErrActionCreating, ResNameVPCNATGatewayEIPAssociation, "", err), + err.Error(), + ) + return + } + plan.ID = types.StringValue(id) + + input := ec2.AssociateNatGatewayAddressInput{ + NatGatewayId: plan.NATGatewayID.ValueStringPointer(), + AllocationIds: []string{plan.AllocationID.ValueString()}, + } + + _, err = conn.AssociateNatGatewayAddress(ctx, &input) + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.EC2, create.ErrActionCreating, ResNameVPCNATGatewayEIPAssociation, plan.ID.String(), err), + err.Error(), + ) + return + } + + createTimeout := r.CreateTimeout(ctx, plan.Timeouts) + out, err := waitNATGatewayAddressAssociated(ctx, conn, plan.NATGatewayID.ValueString(), plan.AllocationID.ValueString(), createTimeout) + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.EC2, create.ErrActionWaitingForCreation, ResNameVPCNATGatewayEIPAssociation, plan.ID.String(), err), + err.Error(), + ) + return + } + + plan.AssociationID = types.StringPointerValue(out.AssociationId) + + resp.Diagnostics.Append(resp.State.Set(ctx, plan)...) +} + +func (r *resourceNATGatewayEIPAssociation) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + conn := r.Meta().EC2Client(ctx) + + var state resourceVPCNATGatewayEIPAssociationModel + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + if err := state.InitFromID(); err != nil { + resp.Diagnostics.AddError("parsing resource ID", err.Error()) + return + } + + out, err := findNATGatewayAddressByNATGatewayIDAndAllocationIDSucceeded(ctx, conn, state.NATGatewayID.ValueString(), state.AllocationID.ValueString()) + if tfresource.NotFound(err) { + resp.Diagnostics.Append(fwdiag.NewResourceNotFoundWarningDiagnostic(err)) + resp.State.RemoveResource(ctx) + return + } + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.EC2, create.ErrActionReading, ResNameVPCNATGatewayEIPAssociation, state.ID.String(), err), + err.Error(), + ) + return + } + + resp.Diagnostics.Append(flex.Flatten(ctx, out, &state)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +func (r *resourceNATGatewayEIPAssociation) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { +} + +func (r *resourceNATGatewayEIPAssociation) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + conn := r.Meta().EC2Client(ctx) + + var state resourceVPCNATGatewayEIPAssociationModel + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + input := ec2.DisassociateNatGatewayAddressInput{ + NatGatewayId: state.NATGatewayID.ValueStringPointer(), + AssociationIds: []string{state.AssociationID.ValueString()}, + } + + _, err := conn.DisassociateNatGatewayAddress(ctx, &input) + + if tfawserr.ErrCodeEquals(err, "InvalidParameter") { + return + } + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.EC2, create.ErrActionDeleting, ResNameVPCNATGatewayEIPAssociation, state.ID.String(), err), + err.Error(), + ) + return + } + + deleteTimeout := r.DeleteTimeout(ctx, state.Timeouts) + _, err = waitNATGatewayAddressDisassociated(ctx, conn, state.NATGatewayID.ValueString(), state.AllocationID.ValueString(), deleteTimeout) + if err != nil { + resp.Diagnostics.AddError( + create.ProblemStandardMessage(names.EC2, create.ErrActionWaitingForDeletion, ResNameVPCNATGatewayEIPAssociation, state.ID.String(), err), + err.Error(), + ) + return + } +} + +func (r *resourceNATGatewayEIPAssociation) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root(names.AttrID), req, resp) +} + +type resourceVPCNATGatewayEIPAssociationModel struct { + AllocationID types.String `tfsdk:"allocation_id"` + AssociationID types.String `tfsdk:"association_id"` + ID types.String `tfsdk:"id"` + NATGatewayID types.String `tfsdk:"nat_gateway_id"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +const ( + natGatewayEIPAssociationParts = 2 +) + +func (m *resourceVPCNATGatewayEIPAssociationModel) InitFromID() error { + id := m.ID.ValueString() + parts, err := fwflex.ExpandResourceId(id, natGatewayEIPAssociationParts, false) + + if err != nil { + return err + } + + m.NATGatewayID = types.StringValue(parts[0]) + m.AllocationID = types.StringValue(parts[1]) + + return nil +} + +func (m resourceVPCNATGatewayEIPAssociationModel) setID() (string, error) { + parts := []string{ + m.NATGatewayID.ValueString(), + m.AllocationID.ValueString(), + } + + return fwflex.FlattenResourceId(parts, natGatewayEIPAssociationParts, false) +} diff --git a/internal/service/ec2/vpc_nat_gateway_eip_association_test.go b/internal/service/ec2/vpc_nat_gateway_eip_association_test.go new file mode 100644 index 000000000000..ca3043caea1a --- /dev/null +++ b/internal/service/ec2/vpc_nat_gateway_eip_association_test.go @@ -0,0 +1,149 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package ec2_test + +import ( + "context" + "errors" + "fmt" + "testing" + + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/create" + tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccVPCNATGatewayEIPAssociation_basic(t *testing.T) { + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var vpcnatgatewayeipassociation types.NatGatewayAddress + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_nat_gateway_eip_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckVPCNATGatewayEIPAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccVPCNATGatewayEIPAssociationConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckVPCNATGatewayEIPAssociationExists(ctx, resourceName, &vpcnatgatewayeipassociation), + resource.TestCheckResourceAttrPair(resourceName, "allocation_id", "aws_eip.secondary", names.AttrID), + resource.TestCheckResourceAttrPair(resourceName, "nat_gateway_id", "aws_nat_gateway.test", names.AttrID), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccVPCNATGatewayEIPAssociation_disappears(t *testing.T) { + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var vpcnatgatewayeipassociation types.NatGatewayAddress + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_nat_gateway_eip_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.EC2ServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckVPCNATGatewayEIPAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccVPCNATGatewayEIPAssociationConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckVPCNATGatewayEIPAssociationExists(ctx, resourceName, &vpcnatgatewayeipassociation), + acctest.CheckFrameworkResourceDisappears(ctx, acctest.Provider, tfec2.ResourceNATGatewayEIPAssociation, resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccCheckVPCNATGatewayEIPAssociationDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Client(ctx) + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_nat_gateway_eip_association" { + continue + } + + _, err := tfec2.FindNATGatewayAddressByNATGatewayIDAndAllocationIDSucceeded(ctx, conn, rs.Primary.Attributes["nat_gateway_id"], rs.Primary.Attributes["allocation_id"]) + if tfresource.NotFound(err) { + return nil + } + if err != nil { + return create.Error(names.EC2, create.ErrActionCheckingDestroyed, tfec2.ResNameVPCNATGatewayEIPAssociation, rs.Primary.ID, err) + } + + return create.Error(names.EC2, create.ErrActionCheckingDestroyed, tfec2.ResNameVPCNATGatewayEIPAssociation, rs.Primary.ID, errors.New("not destroyed")) + } + + return nil + } +} + +func testAccCheckVPCNATGatewayEIPAssociationExists(ctx context.Context, name string, vpcnatgatewayeipassociation *types.NatGatewayAddress) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return create.Error(names.EC2, create.ErrActionCheckingExistence, tfec2.ResNameVPCNATGatewayEIPAssociation, name, errors.New("not found")) + } + + if rs.Primary.ID == "" { + return create.Error(names.EC2, create.ErrActionCheckingExistence, tfec2.ResNameVPCNATGatewayEIPAssociation, name, errors.New("not set")) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Client(ctx) + + resp, err := tfec2.FindNATGatewayAddressByNATGatewayIDAndAllocationIDSucceeded(ctx, conn, rs.Primary.Attributes["nat_gateway_id"], rs.Primary.Attributes["allocation_id"]) + if err != nil { + return create.Error(names.EC2, create.ErrActionCheckingExistence, tfec2.ResNameVPCNATGatewayEIPAssociation, rs.Primary.ID, err) + } + + *vpcnatgatewayeipassociation = *resp + + return nil + } +} + +func testAccVPCNATGatewayEIPAssociationConfig_basic(rName string) string { + return acctest.ConfigCompose(testAccVPCNATGatewayConfig_basic(rName), + fmt.Sprintf(` +resource "aws_eip" "secondary" { + domain = "vpc" + + tags = { + Name = %[1]q + } +} + +resource "aws_nat_gateway_eip_association" "test" { + allocation_id = aws_eip.secondary.id + nat_gateway_id = aws_nat_gateway.test.id +} +`, rName)) +} diff --git a/internal/service/ec2/wait.go b/internal/service/ec2/wait.go index b811f28dfb93..e9a2e3f9bf04 100644 --- a/internal/service/ec2/wait.go +++ b/internal/service/ec2/wait.go @@ -1251,10 +1251,11 @@ func waitNATGatewayAddressAssigned(ctx context.Context, conn *ec2.Client, natGat func waitNATGatewayAddressAssociated(ctx context.Context, conn *ec2.Client, natGatewayID, allocationID string, timeout time.Duration) (*awstypes.NatGatewayAddress, error) { stateConf := &retry.StateChangeConf{ - Pending: enum.Slice(awstypes.NatGatewayAddressStatusAssociating), - Target: enum.Slice(awstypes.NatGatewayAddressStatusSucceeded), - Refresh: statusNATGatewayAddressByNATGatewayIDAndAllocationID(ctx, conn, natGatewayID, allocationID), - Timeout: timeout, + Pending: enum.Slice(awstypes.NatGatewayAddressStatusAssociating), + Target: enum.Slice(awstypes.NatGatewayAddressStatusSucceeded), + Refresh: statusNATGatewayAddressByNATGatewayIDAndAllocationID(ctx, conn, natGatewayID, allocationID), + Timeout: timeout, + ContinuousTargetOccurence: 5, } outputRaw, err := stateConf.WaitForStateContext(ctx) @@ -1272,10 +1273,11 @@ func waitNATGatewayAddressAssociated(ctx context.Context, conn *ec2.Client, natG func waitNATGatewayAddressDisassociated(ctx context.Context, conn *ec2.Client, natGatewayID, allocationID string, timeout time.Duration) (*awstypes.NatGatewayAddress, error) { stateConf := &retry.StateChangeConf{ - Pending: enum.Slice(awstypes.NatGatewayAddressStatusSucceeded, awstypes.NatGatewayAddressStatusDisassociating), - Target: []string{}, - Refresh: statusNATGatewayAddressByNATGatewayIDAndAllocationID(ctx, conn, natGatewayID, allocationID), - Timeout: timeout, + Pending: enum.Slice(awstypes.NatGatewayAddressStatusSucceeded, awstypes.NatGatewayAddressStatusDisassociating), + Target: []string{}, + Refresh: statusNATGatewayAddressByNATGatewayIDAndAllocationID(ctx, conn, natGatewayID, allocationID), + Timeout: timeout, + ContinuousTargetOccurence: 5, } outputRaw, err := stateConf.WaitForStateContext(ctx) diff --git a/website/docs/r/nat_gateway.html.markdown b/website/docs/r/nat_gateway.html.markdown index 1107162916c0..40342cf4d8c7 100644 --- a/website/docs/r/nat_gateway.html.markdown +++ b/website/docs/r/nat_gateway.html.markdown @@ -10,6 +10,8 @@ description: |- Provides a resource to create a VPC NAT Gateway. +!> **WARNING:** You should not use the `aws_nat_gateway` resource that has `secondary_allocation_ids` in conjunction with an [`aws_nat_gateway_eip_association`](nat_gateway_eip_association.html) resource. Doing so may cause perpetual differences, and result in associations being overwritten. + ## Example Usage ### Public NAT diff --git a/website/docs/r/nat_gateway_eip_association.html.markdown b/website/docs/r/nat_gateway_eip_association.html.markdown new file mode 100644 index 000000000000..49f4807f467e --- /dev/null +++ b/website/docs/r/nat_gateway_eip_association.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_nat_gateway_eip_association" +description: |- + Terraform resource for managing an AWS VPC NAT Gateway EIP Association. +--- +# Resource: aws_nat_gateway_eip_association + +Terraform resource for managing an AWS VPC NAT Gateway EIP Association. + +!> **WARNING:** You should not use the `aws_nat_gateway_eip_association` resource in conjunction with an [`aws_nat_gateway`](aws_nat_gateway.html) resource that has `secondary_allocation_ids` configured. Doing so may cause perpetual differences, and result in associations being overwritten. + +## Example Usage + +### Basic Usage + +```terraform +resource "aws_nat_gateway_eip_association" "example" { + allocation_id = aws_eip.example.id + nat_gateway_id = aws_nat_gateway.example.id +} +``` + +## Argument Reference + +The following arguments are required: + +* `allocation_id` - (Required) The ID of the Elastic IP Allocation to associate with the NAT Gateway. +* `nat_gateway_id` - (Required) The ID of the NAT Gateway to associate the Elastic IP Allocation to. + +## Attribute Reference + +This resource exports the following attributes in addition to the arguments above: + +* `id` - ID of the VPC NAT Gateway EIP Association. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `10m`) +* `update` - (Default `10m`) +* `delete` - (Default `30m`) + +## Import + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import VPC NAT Gateway EIP Association using the `example_id_arg`. For example: + +```terraform +import { + to = aws_nat_gateway_eip_association.example + id = "nat-1234567890abcdef1,eipalloc-1234567890abcdef1" +} +``` + +Using `terraform import`, import VPC NAT Gateway EIP Association using the `example_id_arg`. For example: + +```console +% terraform import aws_nat_gateway_eip_association.example nat-1234567890abcdef1,eipalloc-1234567890abcdef1 +```