Update, or delete a VPN gateway advertised cidr. For more information, about VPN gateway, see adding connections to a VPN gateway.
Note:
VPC infrastructure services are a regional specific based endpoint, by default targets to us-south. Please make sure to target right region in the provider block as shown in the provider.tf file, if VPC service is created in region other than us-south.
provider.tf
import * as pulumi from "@pulumi/pulumi";
import pulumi
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
return await Deployment.RunAsync(() =>
{
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
}
}
{}
Example Usage
The following example creates a VPN gateway:
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const example = new ibm.IsVpc("example", {name: "example-vpc"});
const exampleIsSubnet = new ibm.IsSubnet("example", {
name: "example-subnet",
vpc: example.isVpcId,
zone: "us-south-1",
ipv4CidrBlock: "10.240.0.0/24",
});
const example2 = new ibm.IsSubnet("example2", {
name: "example-subnet2",
vpc: example.isVpcId,
zone: "us-south-2",
ipv4CidrBlock: "10.240.68.0/24",
});
const exampleIsVpnGateway = new ibm.IsVpnGateway("example", {
name: "example-vpn-gateway",
subnet: exampleIsSubnet.isSubnetId,
mode: "route",
});
const exampleIsVpnGatewayAdvertisedCidr = new ibm.IsVpnGatewayAdvertisedCidr("example", {
vpnGateway: exampleIsVpnGateway.isVpnGatewayId,
cidr: "10.45.0.0/24",
});
import pulumi
import pulumi_ibm as ibm
example = ibm.IsVpc("example", name="example-vpc")
example_is_subnet = ibm.IsSubnet("example",
name="example-subnet",
vpc=example.is_vpc_id,
zone="us-south-1",
ipv4_cidr_block="10.240.0.0/24")
example2 = ibm.IsSubnet("example2",
name="example-subnet2",
vpc=example.is_vpc_id,
zone="us-south-2",
ipv4_cidr_block="10.240.68.0/24")
example_is_vpn_gateway = ibm.IsVpnGateway("example",
name="example-vpn-gateway",
subnet=example_is_subnet.is_subnet_id,
mode="route")
example_is_vpn_gateway_advertised_cidr = ibm.IsVpnGatewayAdvertisedCidr("example",
vpn_gateway=example_is_vpn_gateway.is_vpn_gateway_id,
cidr="10.45.0.0/24")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ibm.NewIsVpc(ctx, "example", &ibm.IsVpcArgs{
Name: pulumi.String("example-vpc"),
})
if err != nil {
return err
}
exampleIsSubnet, err := ibm.NewIsSubnet(ctx, "example", &ibm.IsSubnetArgs{
Name: pulumi.String("example-subnet"),
Vpc: example.IsVpcId,
Zone: pulumi.String("us-south-1"),
Ipv4CidrBlock: pulumi.String("10.240.0.0/24"),
})
if err != nil {
return err
}
_, err = ibm.NewIsSubnet(ctx, "example2", &ibm.IsSubnetArgs{
Name: pulumi.String("example-subnet2"),
Vpc: example.IsVpcId,
Zone: pulumi.String("us-south-2"),
Ipv4CidrBlock: pulumi.String("10.240.68.0/24"),
})
if err != nil {
return err
}
exampleIsVpnGateway, err := ibm.NewIsVpnGateway(ctx, "example", &ibm.IsVpnGatewayArgs{
Name: pulumi.String("example-vpn-gateway"),
Subnet: exampleIsSubnet.IsSubnetId,
Mode: pulumi.String("route"),
})
if err != nil {
return err
}
_, err = ibm.NewIsVpnGatewayAdvertisedCidr(ctx, "example", &ibm.IsVpnGatewayAdvertisedCidrArgs{
VpnGateway: exampleIsVpnGateway.IsVpnGatewayId,
Cidr: pulumi.String("10.45.0.0/24"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var example = new Ibm.IsVpc("example", new()
{
Name = "example-vpc",
});
var exampleIsSubnet = new Ibm.IsSubnet("example", new()
{
Name = "example-subnet",
Vpc = example.IsVpcId,
Zone = "us-south-1",
Ipv4CidrBlock = "10.240.0.0/24",
});
var example2 = new Ibm.IsSubnet("example2", new()
{
Name = "example-subnet2",
Vpc = example.IsVpcId,
Zone = "us-south-2",
Ipv4CidrBlock = "10.240.68.0/24",
});
var exampleIsVpnGateway = new Ibm.IsVpnGateway("example", new()
{
Name = "example-vpn-gateway",
Subnet = exampleIsSubnet.IsSubnetId,
Mode = "route",
});
var exampleIsVpnGatewayAdvertisedCidr = new Ibm.IsVpnGatewayAdvertisedCidr("example", new()
{
VpnGateway = exampleIsVpnGateway.IsVpnGatewayId,
Cidr = "10.45.0.0/24",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IsVpc;
import com.pulumi.ibm.IsVpcArgs;
import com.pulumi.ibm.IsSubnet;
import com.pulumi.ibm.IsSubnetArgs;
import com.pulumi.ibm.IsVpnGateway;
import com.pulumi.ibm.IsVpnGatewayArgs;
import com.pulumi.ibm.IsVpnGatewayAdvertisedCidr;
import com.pulumi.ibm.IsVpnGatewayAdvertisedCidrArgs;
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 example = new IsVpc("example", IsVpcArgs.builder()
.name("example-vpc")
.build());
var exampleIsSubnet = new IsSubnet("exampleIsSubnet", IsSubnetArgs.builder()
.name("example-subnet")
.vpc(example.isVpcId())
.zone("us-south-1")
.ipv4CidrBlock("10.240.0.0/24")
.build());
var example2 = new IsSubnet("example2", IsSubnetArgs.builder()
.name("example-subnet2")
.vpc(example.isVpcId())
.zone("us-south-2")
.ipv4CidrBlock("10.240.68.0/24")
.build());
var exampleIsVpnGateway = new IsVpnGateway("exampleIsVpnGateway", IsVpnGatewayArgs.builder()
.name("example-vpn-gateway")
.subnet(exampleIsSubnet.isSubnetId())
.mode("route")
.build());
var exampleIsVpnGatewayAdvertisedCidr = new IsVpnGatewayAdvertisedCidr("exampleIsVpnGatewayAdvertisedCidr", IsVpnGatewayAdvertisedCidrArgs.builder()
.vpnGateway(exampleIsVpnGateway.isVpnGatewayId())
.cidr("10.45.0.0/24")
.build());
}
}
resources:
example:
type: ibm:IsVpc
properties:
name: example-vpc
exampleIsSubnet:
type: ibm:IsSubnet
name: example
properties:
name: example-subnet
vpc: ${example.isVpcId}
zone: us-south-1
ipv4CidrBlock: 10.240.0.0/24
example2:
type: ibm:IsSubnet
properties:
name: example-subnet2
vpc: ${example.isVpcId}
zone: us-south-2
ipv4CidrBlock: 10.240.68.0/24
exampleIsVpnGateway:
type: ibm:IsVpnGateway
name: example
properties:
name: example-vpn-gateway
subnet: ${exampleIsSubnet.isSubnetId}
mode: route
exampleIsVpnGatewayAdvertisedCidr:
type: ibm:IsVpnGatewayAdvertisedCidr
name: example
properties:
vpnGateway: ${exampleIsVpnGateway.isVpnGatewayId}
cidr: 10.45.0.0/24
Create IsVpnGatewayAdvertisedCidr Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IsVpnGatewayAdvertisedCidr(name: string, args: IsVpnGatewayAdvertisedCidrArgs, opts?: CustomResourceOptions);@overload
def IsVpnGatewayAdvertisedCidr(resource_name: str,
args: IsVpnGatewayAdvertisedCidrArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IsVpnGatewayAdvertisedCidr(resource_name: str,
opts: Optional[ResourceOptions] = None,
cidr: Optional[str] = None,
vpn_gateway: Optional[str] = None,
is_vpn_gateway_advertised_cidr_id: Optional[str] = None,
timeouts: Optional[IsVpnGatewayAdvertisedCidrTimeoutsArgs] = None)func NewIsVpnGatewayAdvertisedCidr(ctx *Context, name string, args IsVpnGatewayAdvertisedCidrArgs, opts ...ResourceOption) (*IsVpnGatewayAdvertisedCidr, error)public IsVpnGatewayAdvertisedCidr(string name, IsVpnGatewayAdvertisedCidrArgs args, CustomResourceOptions? opts = null)
public IsVpnGatewayAdvertisedCidr(String name, IsVpnGatewayAdvertisedCidrArgs args)
public IsVpnGatewayAdvertisedCidr(String name, IsVpnGatewayAdvertisedCidrArgs args, CustomResourceOptions options)
type: ibm:IsVpnGatewayAdvertisedCidr
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args IsVpnGatewayAdvertisedCidrArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args IsVpnGatewayAdvertisedCidrArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args IsVpnGatewayAdvertisedCidrArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IsVpnGatewayAdvertisedCidrArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IsVpnGatewayAdvertisedCidrArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var isVpnGatewayAdvertisedCidrResource = new Ibm.IsVpnGatewayAdvertisedCidr("isVpnGatewayAdvertisedCidrResource", new()
{
Cidr = "string",
VpnGateway = "string",
IsVpnGatewayAdvertisedCidrId = "string",
Timeouts = new Ibm.Inputs.IsVpnGatewayAdvertisedCidrTimeoutsArgs
{
Delete = "string",
},
});
example, err := ibm.NewIsVpnGatewayAdvertisedCidr(ctx, "isVpnGatewayAdvertisedCidrResource", &ibm.IsVpnGatewayAdvertisedCidrArgs{
Cidr: pulumi.String("string"),
VpnGateway: pulumi.String("string"),
IsVpnGatewayAdvertisedCidrId: pulumi.String("string"),
Timeouts: &ibm.IsVpnGatewayAdvertisedCidrTimeoutsArgs{
Delete: pulumi.String("string"),
},
})
var isVpnGatewayAdvertisedCidrResource = new IsVpnGatewayAdvertisedCidr("isVpnGatewayAdvertisedCidrResource", IsVpnGatewayAdvertisedCidrArgs.builder()
.cidr("string")
.vpnGateway("string")
.isVpnGatewayAdvertisedCidrId("string")
.timeouts(IsVpnGatewayAdvertisedCidrTimeoutsArgs.builder()
.delete("string")
.build())
.build());
is_vpn_gateway_advertised_cidr_resource = ibm.IsVpnGatewayAdvertisedCidr("isVpnGatewayAdvertisedCidrResource",
cidr="string",
vpn_gateway="string",
is_vpn_gateway_advertised_cidr_id="string",
timeouts={
"delete": "string",
})
const isVpnGatewayAdvertisedCidrResource = new ibm.IsVpnGatewayAdvertisedCidr("isVpnGatewayAdvertisedCidrResource", {
cidr: "string",
vpnGateway: "string",
isVpnGatewayAdvertisedCidrId: "string",
timeouts: {
"delete": "string",
},
});
type: ibm:IsVpnGatewayAdvertisedCidr
properties:
cidr: string
isVpnGatewayAdvertisedCidrId: string
timeouts:
delete: string
vpnGateway: string
IsVpnGatewayAdvertisedCidr Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IsVpnGatewayAdvertisedCidr resource accepts the following input properties:
- Cidr string
- The IP address range in CIDR block notation.
- Vpn
Gateway string - The unique identifier of the VPN gateway.
- Is
Vpn stringGateway Advertised Cidr Id - Timeouts
Is
Vpn Gateway Advertised Cidr Timeouts
- Cidr string
- The IP address range in CIDR block notation.
- Vpn
Gateway string - The unique identifier of the VPN gateway.
- Is
Vpn stringGateway Advertised Cidr Id - Timeouts
Is
Vpn Gateway Advertised Cidr Timeouts Args
- cidr String
- The IP address range in CIDR block notation.
- vpn
Gateway String - The unique identifier of the VPN gateway.
- is
Vpn StringGateway Advertised Cidr Id - timeouts
Is
Vpn Gateway Advertised Cidr Timeouts
- cidr string
- The IP address range in CIDR block notation.
- vpn
Gateway string - The unique identifier of the VPN gateway.
- is
Vpn stringGateway Advertised Cidr Id - timeouts
Is
Vpn Gateway Advertised Cidr Timeouts
- cidr str
- The IP address range in CIDR block notation.
- vpn_
gateway str - The unique identifier of the VPN gateway.
- is_
vpn_ strgateway_ advertised_ cidr_ id - timeouts
Is
Vpn Gateway Advertised Cidr Timeouts Args
- cidr String
- The IP address range in CIDR block notation.
- vpn
Gateway String - The unique identifier of the VPN gateway.
- is
Vpn StringGateway Advertised Cidr Id - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the IsVpnGatewayAdvertisedCidr resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing IsVpnGatewayAdvertisedCidr Resource
Get an existing IsVpnGatewayAdvertisedCidr resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: IsVpnGatewayAdvertisedCidrState, opts?: CustomResourceOptions): IsVpnGatewayAdvertisedCidr@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cidr: Optional[str] = None,
is_vpn_gateway_advertised_cidr_id: Optional[str] = None,
timeouts: Optional[IsVpnGatewayAdvertisedCidrTimeoutsArgs] = None,
vpn_gateway: Optional[str] = None) -> IsVpnGatewayAdvertisedCidrfunc GetIsVpnGatewayAdvertisedCidr(ctx *Context, name string, id IDInput, state *IsVpnGatewayAdvertisedCidrState, opts ...ResourceOption) (*IsVpnGatewayAdvertisedCidr, error)public static IsVpnGatewayAdvertisedCidr Get(string name, Input<string> id, IsVpnGatewayAdvertisedCidrState? state, CustomResourceOptions? opts = null)public static IsVpnGatewayAdvertisedCidr get(String name, Output<String> id, IsVpnGatewayAdvertisedCidrState state, CustomResourceOptions options)resources: _: type: ibm:IsVpnGatewayAdvertisedCidr get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Cidr string
- The IP address range in CIDR block notation.
- Is
Vpn stringGateway Advertised Cidr Id - Timeouts
Is
Vpn Gateway Advertised Cidr Timeouts - Vpn
Gateway string - The unique identifier of the VPN gateway.
- Cidr string
- The IP address range in CIDR block notation.
- Is
Vpn stringGateway Advertised Cidr Id - Timeouts
Is
Vpn Gateway Advertised Cidr Timeouts Args - Vpn
Gateway string - The unique identifier of the VPN gateway.
- cidr String
- The IP address range in CIDR block notation.
- is
Vpn StringGateway Advertised Cidr Id - timeouts
Is
Vpn Gateway Advertised Cidr Timeouts - vpn
Gateway String - The unique identifier of the VPN gateway.
- cidr string
- The IP address range in CIDR block notation.
- is
Vpn stringGateway Advertised Cidr Id - timeouts
Is
Vpn Gateway Advertised Cidr Timeouts - vpn
Gateway string - The unique identifier of the VPN gateway.
- cidr str
- The IP address range in CIDR block notation.
- is_
vpn_ strgateway_ advertised_ cidr_ id - timeouts
Is
Vpn Gateway Advertised Cidr Timeouts Args - vpn_
gateway str - The unique identifier of the VPN gateway.
- cidr String
- The IP address range in CIDR block notation.
- is
Vpn StringGateway Advertised Cidr Id - timeouts Property Map
- vpn
Gateway String - The unique identifier of the VPN gateway.
Supporting Types
IsVpnGatewayAdvertisedCidrTimeouts, IsVpnGatewayAdvertisedCidrTimeoutsArgs
- Delete string
- Delete string
- delete String
- delete string
- delete str
- delete String
Import
The ibm_is_vpn_gateway_advertised_cidr resource can be imported by using the VPN gateway ID and the Advertised Cidr.
Syntax
$ pulumi import ibm:index/isVpnGatewayAdvertisedCidr:IsVpnGatewayAdvertisedCidr example <vpn_gateway_ID>/<cidr>
Example
$ pulumi import ibm:index/isVpnGatewayAdvertisedCidr:IsVpnGatewayAdvertisedCidr example d7bec597-4726-451f-8a63-e62e6f19c32c/10.45.0.0/24
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibmTerraform Provider.
