com.pulumi.azurenative.peering.Peering Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azurenative.peering;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.peering.PeeringArgs;
import com.pulumi.azurenative.peering.outputs.PeeringPropertiesDirectResponse;
import com.pulumi.azurenative.peering.outputs.PeeringPropertiesExchangeResponse;
import com.pulumi.azurenative.peering.outputs.PeeringSkuResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location.
* Azure REST API version: 2022-10-01. Prior API version in Azure Native 1.x: 2021-01-01.
*
* ## Example Usage
* ### Create a direct peering
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.peering.Peering;
* import com.pulumi.azurenative.peering.PeeringArgs;
* import com.pulumi.azurenative.peering.inputs.PeeringPropertiesDirectArgs;
* import com.pulumi.azurenative.peering.inputs.SubResourceArgs;
* import com.pulumi.azurenative.peering.inputs.PeeringSkuArgs;
* import java.util.List;
* import java.util.ArrayList;
* 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 peering = new Peering("peering", PeeringArgs.builder()
* .direct(PeeringPropertiesDirectArgs.builder()
* .connections(
* DirectConnectionArgs.builder()
* .bandwidthInMbps(10000)
* .bgpSession(BgpSessionArgs.builder()
* .maxPrefixesAdvertisedV4(1000)
* .maxPrefixesAdvertisedV6(100)
* .md5AuthenticationKey("test-md5-auth-key")
* .sessionPrefixV4("192.168.0.0/31")
* .sessionPrefixV6("fd00::0/127")
* .build())
* .connectionIdentifier("5F4CB5C7-6B43-4444-9338-9ABC72606C16")
* .peeringDBFacilityId(99999)
* .sessionAddressProvider("Peer")
* .useForPeeringService(false)
* .build(),
* DirectConnectionArgs.builder()
* .bandwidthInMbps(10000)
* .connectionIdentifier("8AB00818-D533-4504-A25A-03A17F61201C")
* .peeringDBFacilityId(99999)
* .sessionAddressProvider("Microsoft")
* .useForPeeringService(true)
* .build())
* .directPeeringType("Edge")
* .peerAsn(SubResourceArgs.builder()
* .id("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1")
* .build())
* .build())
* .kind("Direct")
* .location("eastus")
* .peeringLocation("peeringLocation0")
* .peeringName("peeringName")
* .resourceGroupName("rgName")
* .sku(PeeringSkuArgs.builder()
* .name("Basic_Direct_Free")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create a peering with exchange route server
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.peering.Peering;
* import com.pulumi.azurenative.peering.PeeringArgs;
* import com.pulumi.azurenative.peering.inputs.PeeringPropertiesDirectArgs;
* import com.pulumi.azurenative.peering.inputs.SubResourceArgs;
* import com.pulumi.azurenative.peering.inputs.PeeringSkuArgs;
* import java.util.List;
* import java.util.ArrayList;
* 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 peering = new Peering("peering", PeeringArgs.builder()
* .direct(PeeringPropertiesDirectArgs.builder()
* .connections(DirectConnectionArgs.builder()
* .bandwidthInMbps(10000)
* .bgpSession(BgpSessionArgs.builder()
* .maxPrefixesAdvertisedV4(1000)
* .maxPrefixesAdvertisedV6(100)
* .microsoftSessionIPv4Address("192.168.0.123")
* .peerSessionIPv4Address("192.168.0.234")
* .sessionPrefixV4("192.168.0.0/24")
* .build())
* .connectionIdentifier("5F4CB5C7-6B43-4444-9338-9ABC72606C16")
* .peeringDBFacilityId(99999)
* .sessionAddressProvider("Peer")
* .useForPeeringService(true)
* .build())
* .directPeeringType("IxRs")
* .peerAsn(SubResourceArgs.builder()
* .id("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1")
* .build())
* .build())
* .kind("Direct")
* .location("eastus")
* .peeringLocation("peeringLocation0")
* .peeringName("peeringName")
* .resourceGroupName("rgName")
* .sku(PeeringSkuArgs.builder()
* .name("Premium_Direct_Free")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create an exchange peering
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.peering.Peering;
* import com.pulumi.azurenative.peering.PeeringArgs;
* import com.pulumi.azurenative.peering.inputs.PeeringPropertiesExchangeArgs;
* import com.pulumi.azurenative.peering.inputs.SubResourceArgs;
* import com.pulumi.azurenative.peering.inputs.PeeringSkuArgs;
* import java.util.List;
* import java.util.ArrayList;
* 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 peering = new Peering("peering", PeeringArgs.builder()
* .exchange(PeeringPropertiesExchangeArgs.builder()
* .connections(
* ExchangeConnectionArgs.builder()
* .bgpSession(BgpSessionArgs.builder()
* .maxPrefixesAdvertisedV4(1000)
* .maxPrefixesAdvertisedV6(100)
* .md5AuthenticationKey("test-md5-auth-key")
* .peerSessionIPv4Address("192.168.2.1")
* .peerSessionIPv6Address("fd00::1")
* .build())
* .connectionIdentifier("CE495334-0E94-4E51-8164-8116D6CD284D")
* .peeringDBFacilityId(99999)
* .build(),
* ExchangeConnectionArgs.builder()
* .bgpSession(BgpSessionArgs.builder()
* .maxPrefixesAdvertisedV4(1000)
* .maxPrefixesAdvertisedV6(100)
* .md5AuthenticationKey("test-md5-auth-key")
* .peerSessionIPv4Address("192.168.2.2")
* .peerSessionIPv6Address("fd00::2")
* .build())
* .connectionIdentifier("CDD8E673-CB07-47E6-84DE-3739F778762B")
* .peeringDBFacilityId(99999)
* .build())
* .peerAsn(SubResourceArgs.builder()
* .id("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1")
* .build())
* .build())
* .kind("Exchange")
* .location("eastus")
* .peeringLocation("peeringLocation0")
* .peeringName("peeringName")
* .resourceGroupName("rgName")
* .sku(PeeringSkuArgs.builder()
* .name("Basic_Exchange_Free")
* .build())
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:peering:Peering peeringName /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}
* ```
*
*/
@ResourceType(type="azure-native:peering:Peering")
public class Peering extends com.pulumi.resources.CustomResource {
/**
* The properties that define a direct peering.
*
*/
@Export(name="direct", refs={PeeringPropertiesDirectResponse.class}, tree="[0]")
private Output* @Nullable */ PeeringPropertiesDirectResponse> direct;
/**
* @return The properties that define a direct peering.
*
*/
public Output> direct() {
return Codegen.optional(this.direct);
}
/**
* The properties that define an exchange peering.
*
*/
@Export(name="exchange", refs={PeeringPropertiesExchangeResponse.class}, tree="[0]")
private Output* @Nullable */ PeeringPropertiesExchangeResponse> exchange;
/**
* @return The properties that define an exchange peering.
*
*/
public Output> exchange() {
return Codegen.optional(this.exchange);
}
/**
* The kind of the peering.
*
*/
@Export(name="kind", refs={String.class}, tree="[0]")
private Output kind;
/**
* @return The kind of the peering.
*
*/
public Output kind() {
return this.kind;
}
/**
* The location of the resource.
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The location of the resource.
*
*/
public Output location() {
return this.location;
}
/**
* The name of the resource.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource.
*
*/
public Output name() {
return this.name;
}
/**
* The location of the peering.
*
*/
@Export(name="peeringLocation", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> peeringLocation;
/**
* @return The location of the peering.
*
*/
public Output> peeringLocation() {
return Codegen.optional(this.peeringLocation);
}
/**
* The provisioning state of the resource.
*
*/
@Export(name="provisioningState", refs={String.class}, tree="[0]")
private Output provisioningState;
/**
* @return The provisioning state of the resource.
*
*/
public Output provisioningState() {
return this.provisioningState;
}
/**
* The SKU that defines the tier and kind of the peering.
*
*/
@Export(name="sku", refs={PeeringSkuResponse.class}, tree="[0]")
private Output sku;
/**
* @return The SKU that defines the tier and kind of the peering.
*
*/
public Output sku() {
return this.sku;
}
/**
* The resource tags.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return The resource tags.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* The type of the resource.
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource.
*
*/
public Output type() {
return this.type;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Peering(java.lang.String name) {
this(name, PeeringArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Peering(java.lang.String name, PeeringArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public Peering(java.lang.String name, PeeringArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:peering:Peering", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Peering(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:peering:Peering", name, null, makeResourceOptions(options, id), false);
}
private static PeeringArgs makeArgs(PeeringArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? PeeringArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:peering/v20190801preview:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20190901preview:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20200101preview:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20200401:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20201001:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20210101:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20210601:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20220101:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20220601:Peering").build()),
Output.of(Alias.builder().type("azure-native:peering/v20221001:Peering").build())
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static Peering get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Peering(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy