Class SiteToSiteVpnAttachment


  • public class SiteToSiteVpnAttachment
    extends com.pulumi.resources.CustomResource
    Manages a Network Manager site-to-site VPN attachment. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.networkmanager.SiteToSiteVpnAttachment;
     import com.pulumi.aws.networkmanager.SiteToSiteVpnAttachmentArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new SiteToSiteVpnAttachment("example", SiteToSiteVpnAttachmentArgs.builder()
                 .coreNetworkId(exampleAwsccNetworkmanagerCoreNetwork.id())
                 .vpnConnectionArn(exampleAwsVpnConnection.arn())
                 .build());
     
         }
     }
     
     
    ### Full Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ec2.CustomerGateway;
     import com.pulumi.aws.ec2.CustomerGatewayArgs;
     import com.pulumi.aws.ec2.VpnConnection;
     import com.pulumi.aws.ec2.VpnConnectionArgs;
     import com.pulumi.aws.networkmanager.GlobalNetwork;
     import com.pulumi.aws.networkmanager.GlobalNetworkArgs;
     import com.pulumi.aws.networkmanager.NetworkmanagerFunctions;
     import com.pulumi.aws.networkmanager.inputs.GetCoreNetworkPolicyDocumentArgs;
     import com.pulumi.aws.networkmanager.inputs.GetCoreNetworkPolicyDocumentAttachmentPolicyArgs;
     import com.pulumi.aws.networkmanager.inputs.GetCoreNetworkPolicyDocumentAttachmentPolicyActionArgs;
     import com.pulumi.aws.networkmanager.inputs.GetCoreNetworkPolicyDocumentAttachmentPolicyConditionArgs;
     import com.pulumi.aws.networkmanager.inputs.GetCoreNetworkPolicyDocumentCoreNetworkConfigurationArgs;
     import com.pulumi.aws.networkmanager.inputs.GetCoreNetworkPolicyDocumentCoreNetworkConfigurationEdgeLocationArgs;
     import com.pulumi.aws.networkmanager.inputs.GetCoreNetworkPolicyDocumentSegmentActionArgs;
     import com.pulumi.aws.networkmanager.inputs.GetCoreNetworkPolicyDocumentSegmentArgs;
     import com.pulumi.awscc.NetworkmanagerCoreNetwork;
     import com.pulumi.awscc.NetworkmanagerCoreNetworkArgs;
     import com.pulumi.std.StdFunctions;
     import com.pulumi.std.inputs.JsondecodeArgs;
     import com.pulumi.aws.networkmanager.SiteToSiteVpnAttachment;
     import com.pulumi.aws.networkmanager.SiteToSiteVpnAttachmentArgs;
     import com.pulumi.aws.networkmanager.AttachmentAccepter;
     import com.pulumi.aws.networkmanager.AttachmentAccepterArgs;
     import static com.pulumi.codegen.internal.Serialization.*;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var testCustomerGateway = new CustomerGateway("testCustomerGateway", CustomerGatewayArgs.builder()
                 .bgpAsn("65000")
                 .ipAddress("172.0.0.1")
                 .type("ipsec.1")
                 .build());
     
             var testVpnConnection = new VpnConnection("testVpnConnection", VpnConnectionArgs.builder()
                 .customerGatewayId(testCustomerGateway.id())
                 .type("ipsec.1")
                 .tags(Map.of("Name", "test"))
                 .build());
     
             var testGlobalNetwork = new GlobalNetwork("testGlobalNetwork", GlobalNetworkArgs.builder()
                 .tags(Map.of("Name", "test"))
                 .build());
     
             final var test = NetworkmanagerFunctions.getCoreNetworkPolicyDocument(GetCoreNetworkPolicyDocumentArgs.builder()
                 .attachmentPolicies(GetCoreNetworkPolicyDocumentAttachmentPolicyArgs.builder()
                     .action(GetCoreNetworkPolicyDocumentAttachmentPolicyActionArgs.builder()
                         .associationMethod("constant")
                         .segment("shared")
                         .build())
                     .conditions(GetCoreNetworkPolicyDocumentAttachmentPolicyConditionArgs.builder()
                         .type("tag-value")
                         .operator("equals")
                         .key("segment")
                         .value("shared")
                         .build())
                     .ruleNumber(1)
                     .conditionLogic("or")
                     .build())
                 .coreNetworkConfigurations(GetCoreNetworkPolicyDocumentCoreNetworkConfigurationArgs.builder()
                     .edgeLocations(GetCoreNetworkPolicyDocumentCoreNetworkConfigurationEdgeLocationArgs.builder()
                         .location(current.region())
                         .asn("64512")
                         .build())
                     .vpnEcmpSupport(false)
                     .asnRanges("64512-64555")
                     .build())
                 .segmentActions(GetCoreNetworkPolicyDocumentSegmentActionArgs.builder()
                     .action("share")
                     .mode("attachment-route")
                     .segment("shared")
                     .shareWiths("*")
                     .build())
                 .segments(GetCoreNetworkPolicyDocumentSegmentArgs.builder()
                     .name("shared")
                     .description("SegmentForSharedServices")
                     .requireAttachmentAcceptance(true)
                     .build())
                 .build());
     
             var testNetworkmanagerCoreNetwork = new NetworkmanagerCoreNetwork("testNetworkmanagerCoreNetwork", NetworkmanagerCoreNetworkArgs.builder()
                 .globalNetworkId(testGlobalNetwork.id())
                 .policyDocument(serializeJson(
                     StdFunctions.jsondecode(JsondecodeArgs.builder()
                         .input(test.json())
                         .build()).result()))
                 .build());
     
             var testSiteToSiteVpnAttachment = new SiteToSiteVpnAttachment("testSiteToSiteVpnAttachment", SiteToSiteVpnAttachmentArgs.builder()
                 .coreNetworkId(testNetworkmanagerCoreNetwork.id())
                 .vpnConnectionArn(testVpnConnection.arn())
                 .tags(Map.of("segment", "shared"))
                 .build());
     
             var testAttachmentAccepter = new AttachmentAccepter("testAttachmentAccepter", AttachmentAccepterArgs.builder()
                 .attachmentId(testSiteToSiteVpnAttachment.id())
                 .attachmentType(testSiteToSiteVpnAttachment.attachmentType())
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import `aws.networkmanager.SiteToSiteVpnAttachment` using the attachment ID. For example: ```sh $ pulumi import aws:networkmanager/siteToSiteVpnAttachment:SiteToSiteVpnAttachment example attachment-0f8fa60d2238d1bd8 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.lang.Integer> attachmentPolicyRuleNumber()  
      com.pulumi.core.Output<java.lang.String> attachmentType()  
      com.pulumi.core.Output<java.lang.String> coreNetworkArn()  
      com.pulumi.core.Output<java.lang.String> coreNetworkId()  
      com.pulumi.core.Output<java.lang.String> edgeLocation()  
      static SiteToSiteVpnAttachment get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, SiteToSiteVpnAttachmentState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> ownerAccountId()  
      com.pulumi.core.Output<java.lang.String> resourceArn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> routingPolicyLabel()  
      com.pulumi.core.Output<java.lang.String> segmentName()  
      com.pulumi.core.Output<java.lang.String> state()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> vpnConnectionArn()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SiteToSiteVpnAttachment

        public SiteToSiteVpnAttachment​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • SiteToSiteVpnAttachment

        public SiteToSiteVpnAttachment​(java.lang.String name,
                                       SiteToSiteVpnAttachmentArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • SiteToSiteVpnAttachment

        public SiteToSiteVpnAttachment​(java.lang.String name,
                                       SiteToSiteVpnAttachmentArgs args,
                                       @Nullable
                                       com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the attachment.
      • attachmentPolicyRuleNumber

        public com.pulumi.core.Output<java.lang.Integer> attachmentPolicyRuleNumber()
        Returns:
        Policy rule number associated with the attachment.
      • attachmentType

        public com.pulumi.core.Output<java.lang.String> attachmentType()
        Returns:
        Type of attachment.
      • coreNetworkArn

        public com.pulumi.core.Output<java.lang.String> coreNetworkArn()
        Returns:
        ARN of a core network.
      • coreNetworkId

        public com.pulumi.core.Output<java.lang.String> coreNetworkId()
        Returns:
        ID of a core network for the VPN attachment.
      • edgeLocation

        public com.pulumi.core.Output<java.lang.String> edgeLocation()
        Returns:
        Region where the edge is located.
      • ownerAccountId

        public com.pulumi.core.Output<java.lang.String> ownerAccountId()
        Returns:
        ID of the attachment account owner.
      • resourceArn

        public com.pulumi.core.Output<java.lang.String> resourceArn()
        Returns:
        Attachment resource ARN.
      • routingPolicyLabel

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> routingPolicyLabel()
        Returns:
        The routing policy label to apply to the Site-to-Site VPN attachment for traffic routing decisions. Maximum length of 256 characters. Changing this value will force recreation of the resource.
      • segmentName

        public com.pulumi.core.Output<java.lang.String> segmentName()
        Returns:
        Name of the segment attachment.
      • state

        public com.pulumi.core.Output<java.lang.String> state()
        Returns:
        State of the attachment.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Key-value tags for the attachment. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • vpnConnectionArn

        public com.pulumi.core.Output<java.lang.String> vpnConnectionArn()
        Returns:
        ARN of the site-to-site VPN connection. The following arguments are optional:
      • get

        public static SiteToSiteVpnAttachment get​(java.lang.String name,
                                                  com.pulumi.core.Output<java.lang.String> id,
                                                  @Nullable
                                                  SiteToSiteVpnAttachmentState state,
                                                  @Nullable
                                                  com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.