ibm.IsVpcAddressPrefix
Explore with Pulumi AI
Create, update, or delete an IP address prefix. For more information, about IS VPC address prefix, see address prefixes.
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
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const exampleIsVpc = new ibm.IsVpc("exampleIsVpc", {});
const exampleIsVpcAddressPrefix = new ibm.IsVpcAddressPrefix("exampleIsVpcAddressPrefix", {
zone: "us-south-1",
vpc: exampleIsVpc.isVpcId,
cidr: "10.240.0.0/24",
});
import pulumi
import pulumi_ibm as ibm
example_is_vpc = ibm.IsVpc("exampleIsVpc")
example_is_vpc_address_prefix = ibm.IsVpcAddressPrefix("exampleIsVpcAddressPrefix",
zone="us-south-1",
vpc=example_is_vpc.is_vpc_id,
cidr="10.240.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 {
exampleIsVpc, err := ibm.NewIsVpc(ctx, "exampleIsVpc", nil)
if err != nil {
return err
}
_, err = ibm.NewIsVpcAddressPrefix(ctx, "exampleIsVpcAddressPrefix", &ibm.IsVpcAddressPrefixArgs{
Zone: pulumi.String("us-south-1"),
Vpc: exampleIsVpc.IsVpcId,
Cidr: pulumi.String("10.240.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 exampleIsVpc = new Ibm.IsVpc("exampleIsVpc");
var exampleIsVpcAddressPrefix = new Ibm.IsVpcAddressPrefix("exampleIsVpcAddressPrefix", new()
{
Zone = "us-south-1",
Vpc = exampleIsVpc.IsVpcId,
Cidr = "10.240.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.IsVpcAddressPrefix;
import com.pulumi.ibm.IsVpcAddressPrefixArgs;
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 exampleIsVpc = new IsVpc("exampleIsVpc");
var exampleIsVpcAddressPrefix = new IsVpcAddressPrefix("exampleIsVpcAddressPrefix", IsVpcAddressPrefixArgs.builder()
.zone("us-south-1")
.vpc(exampleIsVpc.isVpcId())
.cidr("10.240.0.0/24")
.build());
}
}
resources:
exampleIsVpc:
type: ibm:IsVpc
exampleIsVpcAddressPrefix:
type: ibm:IsVpcAddressPrefix
properties:
zone: us-south-1
vpc: ${exampleIsVpc.isVpcId}
cidr: 10.240.0.0/24
Create IsVpcAddressPrefix Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IsVpcAddressPrefix(name: string, args: IsVpcAddressPrefixArgs, opts?: CustomResourceOptions);
@overload
def IsVpcAddressPrefix(resource_name: str,
args: IsVpcAddressPrefixArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IsVpcAddressPrefix(resource_name: str,
opts: Optional[ResourceOptions] = None,
cidr: Optional[str] = None,
vpc: Optional[str] = None,
zone: Optional[str] = None,
is_default: Optional[bool] = None,
is_vpc_address_prefix_id: Optional[str] = None,
name: Optional[str] = None)
func NewIsVpcAddressPrefix(ctx *Context, name string, args IsVpcAddressPrefixArgs, opts ...ResourceOption) (*IsVpcAddressPrefix, error)
public IsVpcAddressPrefix(string name, IsVpcAddressPrefixArgs args, CustomResourceOptions? opts = null)
public IsVpcAddressPrefix(String name, IsVpcAddressPrefixArgs args)
public IsVpcAddressPrefix(String name, IsVpcAddressPrefixArgs args, CustomResourceOptions options)
type: ibm:IsVpcAddressPrefix
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 IsVpcAddressPrefixArgs
- 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 IsVpcAddressPrefixArgs
- 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 IsVpcAddressPrefixArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IsVpcAddressPrefixArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IsVpcAddressPrefixArgs
- 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 isVpcAddressPrefixResource = new Ibm.IsVpcAddressPrefix("isVpcAddressPrefixResource", new()
{
Cidr = "string",
Vpc = "string",
Zone = "string",
IsDefault = false,
IsVpcAddressPrefixId = "string",
Name = "string",
});
example, err := ibm.NewIsVpcAddressPrefix(ctx, "isVpcAddressPrefixResource", &ibm.IsVpcAddressPrefixArgs{
Cidr: pulumi.String("string"),
Vpc: pulumi.String("string"),
Zone: pulumi.String("string"),
IsDefault: pulumi.Bool(false),
IsVpcAddressPrefixId: pulumi.String("string"),
Name: pulumi.String("string"),
})
var isVpcAddressPrefixResource = new IsVpcAddressPrefix("isVpcAddressPrefixResource", IsVpcAddressPrefixArgs.builder()
.cidr("string")
.vpc("string")
.zone("string")
.isDefault(false)
.isVpcAddressPrefixId("string")
.name("string")
.build());
is_vpc_address_prefix_resource = ibm.IsVpcAddressPrefix("isVpcAddressPrefixResource",
cidr="string",
vpc="string",
zone="string",
is_default=False,
is_vpc_address_prefix_id="string",
name="string")
const isVpcAddressPrefixResource = new ibm.IsVpcAddressPrefix("isVpcAddressPrefixResource", {
cidr: "string",
vpc: "string",
zone: "string",
isDefault: false,
isVpcAddressPrefixId: "string",
name: "string",
});
type: ibm:IsVpcAddressPrefix
properties:
cidr: string
isDefault: false
isVpcAddressPrefixId: string
name: string
vpc: string
zone: string
IsVpcAddressPrefix 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 IsVpcAddressPrefix resource accepts the following input properties:
- Cidr string
- The CIDR block for the address prefix.
- Vpc string
- The VPC ID.
- Zone string
- The name of the zone.
- Is
Default bool - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- Is
Vpc stringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - Name string
- The address prefix name.No.
- Cidr string
- The CIDR block for the address prefix.
- Vpc string
- The VPC ID.
- Zone string
- The name of the zone.
- Is
Default bool - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- Is
Vpc stringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - Name string
- The address prefix name.No.
- cidr String
- The CIDR block for the address prefix.
- vpc String
- The VPC ID.
- zone String
- The name of the zone.
- is
Default Boolean - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- is
Vpc StringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - name String
- The address prefix name.No.
- cidr string
- The CIDR block for the address prefix.
- vpc string
- The VPC ID.
- zone string
- The name of the zone.
- is
Default boolean - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- is
Vpc stringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - name string
- The address prefix name.No.
- cidr str
- The CIDR block for the address prefix.
- vpc str
- The VPC ID.
- zone str
- The name of the zone.
- is_
default bool - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- is_
vpc_ straddress_ prefix_ id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - name str
- The address prefix name.No.
- cidr String
- The CIDR block for the address prefix.
- vpc String
- The VPC ID.
- zone String
- The name of the zone.
- is
Default Boolean - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- is
Vpc StringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - name String
- The address prefix name.No.
Outputs
All input properties are implicitly available as output properties. Additionally, the IsVpcAddressPrefix resource produces the following output properties:
- Address
Prefix string - (String) the unique identifier of the address prefix.
- Has
Subnets bool - (Bool) Indicates whether subnets exist with addresses from this prefix.
- Id string
- The provider-assigned unique ID for this managed resource.
- string
- (String) CRN of the VPC this address prefix belongs to.
- Address
Prefix string - (String) the unique identifier of the address prefix.
- Has
Subnets bool - (Bool) Indicates whether subnets exist with addresses from this prefix.
- Id string
- The provider-assigned unique ID for this managed resource.
- string
- (String) CRN of the VPC this address prefix belongs to.
- address
Prefix String - (String) the unique identifier of the address prefix.
- has
Subnets Boolean - (Bool) Indicates whether subnets exist with addresses from this prefix.
- id String
- The provider-assigned unique ID for this managed resource.
- String
- (String) CRN of the VPC this address prefix belongs to.
- address
Prefix string - (String) the unique identifier of the address prefix.
- has
Subnets boolean - (Bool) Indicates whether subnets exist with addresses from this prefix.
- id string
- The provider-assigned unique ID for this managed resource.
- string
- (String) CRN of the VPC this address prefix belongs to.
- address_
prefix str - (String) the unique identifier of the address prefix.
- has_
subnets bool - (Bool) Indicates whether subnets exist with addresses from this prefix.
- id str
- The provider-assigned unique ID for this managed resource.
- str
- (String) CRN of the VPC this address prefix belongs to.
- address
Prefix String - (String) the unique identifier of the address prefix.
- has
Subnets Boolean - (Bool) Indicates whether subnets exist with addresses from this prefix.
- id String
- The provider-assigned unique ID for this managed resource.
- String
- (String) CRN of the VPC this address prefix belongs to.
Look up Existing IsVpcAddressPrefix Resource
Get an existing IsVpcAddressPrefix 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?: IsVpcAddressPrefixState, opts?: CustomResourceOptions): IsVpcAddressPrefix
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address_prefix: Optional[str] = None,
cidr: Optional[str] = None,
has_subnets: Optional[bool] = None,
is_default: Optional[bool] = None,
is_vpc_address_prefix_id: Optional[str] = None,
name: Optional[str] = None,
related_crn: Optional[str] = None,
vpc: Optional[str] = None,
zone: Optional[str] = None) -> IsVpcAddressPrefix
func GetIsVpcAddressPrefix(ctx *Context, name string, id IDInput, state *IsVpcAddressPrefixState, opts ...ResourceOption) (*IsVpcAddressPrefix, error)
public static IsVpcAddressPrefix Get(string name, Input<string> id, IsVpcAddressPrefixState? state, CustomResourceOptions? opts = null)
public static IsVpcAddressPrefix get(String name, Output<String> id, IsVpcAddressPrefixState state, CustomResourceOptions options)
resources: _: type: ibm:IsVpcAddressPrefix 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.
- Address
Prefix string - (String) the unique identifier of the address prefix.
- Cidr string
- The CIDR block for the address prefix.
- Has
Subnets bool - (Bool) Indicates whether subnets exist with addresses from this prefix.
- Is
Default bool - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- Is
Vpc stringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - Name string
- The address prefix name.No.
- string
- (String) CRN of the VPC this address prefix belongs to.
- Vpc string
- The VPC ID.
- Zone string
- The name of the zone.
- Address
Prefix string - (String) the unique identifier of the address prefix.
- Cidr string
- The CIDR block for the address prefix.
- Has
Subnets bool - (Bool) Indicates whether subnets exist with addresses from this prefix.
- Is
Default bool - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- Is
Vpc stringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - Name string
- The address prefix name.No.
- string
- (String) CRN of the VPC this address prefix belongs to.
- Vpc string
- The VPC ID.
- Zone string
- The name of the zone.
- address
Prefix String - (String) the unique identifier of the address prefix.
- cidr String
- The CIDR block for the address prefix.
- has
Subnets Boolean - (Bool) Indicates whether subnets exist with addresses from this prefix.
- is
Default Boolean - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- is
Vpc StringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - name String
- The address prefix name.No.
- String
- (String) CRN of the VPC this address prefix belongs to.
- vpc String
- The VPC ID.
- zone String
- The name of the zone.
- address
Prefix string - (String) the unique identifier of the address prefix.
- cidr string
- The CIDR block for the address prefix.
- has
Subnets boolean - (Bool) Indicates whether subnets exist with addresses from this prefix.
- is
Default boolean - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- is
Vpc stringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - name string
- The address prefix name.No.
- string
- (String) CRN of the VPC this address prefix belongs to.
- vpc string
- The VPC ID.
- zone string
- The name of the zone.
- address_
prefix str - (String) the unique identifier of the address prefix.
- cidr str
- The CIDR block for the address prefix.
- has_
subnets bool - (Bool) Indicates whether subnets exist with addresses from this prefix.
- is_
default bool - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- is_
vpc_ straddress_ prefix_ id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - name str
- The address prefix name.No.
- str
- (String) CRN of the VPC this address prefix belongs to.
- vpc str
- The VPC ID.
- zone str
- The name of the zone.
- address
Prefix String - (String) the unique identifier of the address prefix.
- cidr String
- The CIDR block for the address prefix.
- has
Subnets Boolean - (Bool) Indicates whether subnets exist with addresses from this prefix.
- is
Default Boolean - Makes the prefix as default prefix for this zone in this VPC. Default is
false
- is
Vpc StringAddress Prefix Id - (String) The ID of the address prefix. The ID is composed of
<vpc_id>/<address_prefix_id>
. - name String
- The address prefix name.No.
- String
- (String) CRN of the VPC this address prefix belongs to.
- vpc String
- The VPC ID.
- zone String
- The name of the zone.
Import
The ibm_is_vpc_address_prefix
resource can be imported by using the VPC ID and VPC address prefix ID.
Syntax
$ pulumi import ibm:index/isVpcAddressPrefix:IsVpcAddressPrefix example <vpc_ID>/<address_prefix_ID>
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
ibm
Terraform Provider.