cloudflare.InfrastructureAccessTarget
Explore with Pulumi AI
The Infrastructure Access Target resource allows you to configure Infrastructure Access Targets for an account.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const example = new cloudflare.InfrastructureAccessTarget("example", {
accountId: "f037e56e89293a057740de681ac9abbe",
hostname: "example-target",
ip: {
ipv4: {
ipAddr: "198.51.100.1",
virtualNetworkId: "238dccd1-149b-463d-8228-560ab83a54fd",
},
ipv6: {
ipAddr: "2001:db8::",
virtualNetworkId: "238dccd1-149b-463d-8228-560ab83a54fd",
},
},
});
const ipv4OnlyExample = new cloudflare.InfrastructureAccessTarget("ipv4_only_example", {
accountId: "f037e56e89293a057740de681ac9abbe",
hostname: "example-ipv4-only",
ip: {
ipv4: {
ipAddr: "198.51.100.1",
virtualNetworkId: "238dccd1-149b-463d-8228-560ab83a54fd",
},
},
});
import pulumi
import pulumi_cloudflare as cloudflare
example = cloudflare.InfrastructureAccessTarget("example",
account_id="f037e56e89293a057740de681ac9abbe",
hostname="example-target",
ip={
"ipv4": {
"ip_addr": "198.51.100.1",
"virtual_network_id": "238dccd1-149b-463d-8228-560ab83a54fd",
},
"ipv6": {
"ip_addr": "2001:db8::",
"virtual_network_id": "238dccd1-149b-463d-8228-560ab83a54fd",
},
})
ipv4_only_example = cloudflare.InfrastructureAccessTarget("ipv4_only_example",
account_id="f037e56e89293a057740de681ac9abbe",
hostname="example-ipv4-only",
ip={
"ipv4": {
"ip_addr": "198.51.100.1",
"virtual_network_id": "238dccd1-149b-463d-8228-560ab83a54fd",
},
})
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudflare.NewInfrastructureAccessTarget(ctx, "example", &cloudflare.InfrastructureAccessTargetArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
Hostname: pulumi.String("example-target"),
Ip: &cloudflare.InfrastructureAccessTargetIpArgs{
Ipv4: &cloudflare.InfrastructureAccessTargetIpIpv4Args{
IpAddr: pulumi.String("198.51.100.1"),
VirtualNetworkId: pulumi.String("238dccd1-149b-463d-8228-560ab83a54fd"),
},
Ipv6: &cloudflare.InfrastructureAccessTargetIpIpv6Args{
IpAddr: pulumi.String("2001:db8::"),
VirtualNetworkId: pulumi.String("238dccd1-149b-463d-8228-560ab83a54fd"),
},
},
})
if err != nil {
return err
}
_, err = cloudflare.NewInfrastructureAccessTarget(ctx, "ipv4_only_example", &cloudflare.InfrastructureAccessTargetArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
Hostname: pulumi.String("example-ipv4-only"),
Ip: &cloudflare.InfrastructureAccessTargetIpArgs{
Ipv4: &cloudflare.InfrastructureAccessTargetIpIpv4Args{
IpAddr: pulumi.String("198.51.100.1"),
VirtualNetworkId: pulumi.String("238dccd1-149b-463d-8228-560ab83a54fd"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var example = new Cloudflare.InfrastructureAccessTarget("example", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
Hostname = "example-target",
Ip = new Cloudflare.Inputs.InfrastructureAccessTargetIpArgs
{
Ipv4 = new Cloudflare.Inputs.InfrastructureAccessTargetIpIpv4Args
{
IpAddr = "198.51.100.1",
VirtualNetworkId = "238dccd1-149b-463d-8228-560ab83a54fd",
},
Ipv6 = new Cloudflare.Inputs.InfrastructureAccessTargetIpIpv6Args
{
IpAddr = "2001:db8::",
VirtualNetworkId = "238dccd1-149b-463d-8228-560ab83a54fd",
},
},
});
var ipv4OnlyExample = new Cloudflare.InfrastructureAccessTarget("ipv4_only_example", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
Hostname = "example-ipv4-only",
Ip = new Cloudflare.Inputs.InfrastructureAccessTargetIpArgs
{
Ipv4 = new Cloudflare.Inputs.InfrastructureAccessTargetIpIpv4Args
{
IpAddr = "198.51.100.1",
VirtualNetworkId = "238dccd1-149b-463d-8228-560ab83a54fd",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.InfrastructureAccessTarget;
import com.pulumi.cloudflare.InfrastructureAccessTargetArgs;
import com.pulumi.cloudflare.inputs.InfrastructureAccessTargetIpArgs;
import com.pulumi.cloudflare.inputs.InfrastructureAccessTargetIpIpv4Args;
import com.pulumi.cloudflare.inputs.InfrastructureAccessTargetIpIpv6Args;
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 InfrastructureAccessTarget("example", InfrastructureAccessTargetArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.hostname("example-target")
.ip(InfrastructureAccessTargetIpArgs.builder()
.ipv4(InfrastructureAccessTargetIpIpv4Args.builder()
.ipAddr("198.51.100.1")
.virtualNetworkId("238dccd1-149b-463d-8228-560ab83a54fd")
.build())
.ipv6(InfrastructureAccessTargetIpIpv6Args.builder()
.ipAddr("2001:db8::")
.virtualNetworkId("238dccd1-149b-463d-8228-560ab83a54fd")
.build())
.build())
.build());
var ipv4OnlyExample = new InfrastructureAccessTarget("ipv4OnlyExample", InfrastructureAccessTargetArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.hostname("example-ipv4-only")
.ip(InfrastructureAccessTargetIpArgs.builder()
.ipv4(InfrastructureAccessTargetIpIpv4Args.builder()
.ipAddr("198.51.100.1")
.virtualNetworkId("238dccd1-149b-463d-8228-560ab83a54fd")
.build())
.build())
.build());
}
}
resources:
example:
type: cloudflare:InfrastructureAccessTarget
properties:
accountId: f037e56e89293a057740de681ac9abbe
hostname: example-target
ip:
ipv4:
ipAddr: 198.51.100.1
virtualNetworkId: 238dccd1-149b-463d-8228-560ab83a54fd
ipv6:
ipAddr: '2001:db8::'
virtualNetworkId: 238dccd1-149b-463d-8228-560ab83a54fd
ipv4OnlyExample:
type: cloudflare:InfrastructureAccessTarget
name: ipv4_only_example
properties:
accountId: f037e56e89293a057740de681ac9abbe
hostname: example-ipv4-only
ip:
ipv4:
ipAddr: 198.51.100.1
virtualNetworkId: 238dccd1-149b-463d-8228-560ab83a54fd
Create InfrastructureAccessTarget Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new InfrastructureAccessTarget(name: string, args: InfrastructureAccessTargetArgs, opts?: CustomResourceOptions);
@overload
def InfrastructureAccessTarget(resource_name: str,
args: InfrastructureAccessTargetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def InfrastructureAccessTarget(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
hostname: Optional[str] = None,
ip: Optional[InfrastructureAccessTargetIpArgs] = None)
func NewInfrastructureAccessTarget(ctx *Context, name string, args InfrastructureAccessTargetArgs, opts ...ResourceOption) (*InfrastructureAccessTarget, error)
public InfrastructureAccessTarget(string name, InfrastructureAccessTargetArgs args, CustomResourceOptions? opts = null)
public InfrastructureAccessTarget(String name, InfrastructureAccessTargetArgs args)
public InfrastructureAccessTarget(String name, InfrastructureAccessTargetArgs args, CustomResourceOptions options)
type: cloudflare:InfrastructureAccessTarget
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 InfrastructureAccessTargetArgs
- 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 InfrastructureAccessTargetArgs
- 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 InfrastructureAccessTargetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InfrastructureAccessTargetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InfrastructureAccessTargetArgs
- 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 infrastructureAccessTargetResource = new Cloudflare.InfrastructureAccessTarget("infrastructureAccessTargetResource", new()
{
AccountId = "string",
Hostname = "string",
Ip = new Cloudflare.Inputs.InfrastructureAccessTargetIpArgs
{
Ipv4 = new Cloudflare.Inputs.InfrastructureAccessTargetIpIpv4Args
{
IpAddr = "string",
VirtualNetworkId = "string",
},
Ipv6 = new Cloudflare.Inputs.InfrastructureAccessTargetIpIpv6Args
{
IpAddr = "string",
VirtualNetworkId = "string",
},
},
});
example, err := cloudflare.NewInfrastructureAccessTarget(ctx, "infrastructureAccessTargetResource", &cloudflare.InfrastructureAccessTargetArgs{
AccountId: pulumi.String("string"),
Hostname: pulumi.String("string"),
Ip: &cloudflare.InfrastructureAccessTargetIpArgs{
Ipv4: &cloudflare.InfrastructureAccessTargetIpIpv4Args{
IpAddr: pulumi.String("string"),
VirtualNetworkId: pulumi.String("string"),
},
Ipv6: &cloudflare.InfrastructureAccessTargetIpIpv6Args{
IpAddr: pulumi.String("string"),
VirtualNetworkId: pulumi.String("string"),
},
},
})
var infrastructureAccessTargetResource = new InfrastructureAccessTarget("infrastructureAccessTargetResource", InfrastructureAccessTargetArgs.builder()
.accountId("string")
.hostname("string")
.ip(InfrastructureAccessTargetIpArgs.builder()
.ipv4(InfrastructureAccessTargetIpIpv4Args.builder()
.ipAddr("string")
.virtualNetworkId("string")
.build())
.ipv6(InfrastructureAccessTargetIpIpv6Args.builder()
.ipAddr("string")
.virtualNetworkId("string")
.build())
.build())
.build());
infrastructure_access_target_resource = cloudflare.InfrastructureAccessTarget("infrastructureAccessTargetResource",
account_id="string",
hostname="string",
ip={
"ipv4": {
"ip_addr": "string",
"virtual_network_id": "string",
},
"ipv6": {
"ip_addr": "string",
"virtual_network_id": "string",
},
})
const infrastructureAccessTargetResource = new cloudflare.InfrastructureAccessTarget("infrastructureAccessTargetResource", {
accountId: "string",
hostname: "string",
ip: {
ipv4: {
ipAddr: "string",
virtualNetworkId: "string",
},
ipv6: {
ipAddr: "string",
virtualNetworkId: "string",
},
},
});
type: cloudflare:InfrastructureAccessTarget
properties:
accountId: string
hostname: string
ip:
ipv4:
ipAddr: string
virtualNetworkId: string
ipv6:
ipAddr: string
virtualNetworkId: string
InfrastructureAccessTarget 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 InfrastructureAccessTarget resource accepts the following input properties:
- Account
Id string - The account identifier to target for the resource.
- Hostname string
- A non-unique field that refers to a target.
- Ip
Infrastructure
Access Target Ip - The IPv4/IPv6 address that identifies where to reach a target.
- Account
Id string - The account identifier to target for the resource.
- Hostname string
- A non-unique field that refers to a target.
- Ip
Infrastructure
Access Target Ip Args - The IPv4/IPv6 address that identifies where to reach a target.
- account
Id String - The account identifier to target for the resource.
- hostname String
- A non-unique field that refers to a target.
- ip
Infrastructure
Access Target Ip - The IPv4/IPv6 address that identifies where to reach a target.
- account
Id string - The account identifier to target for the resource.
- hostname string
- A non-unique field that refers to a target.
- ip
Infrastructure
Access Target Ip - The IPv4/IPv6 address that identifies where to reach a target.
- account_
id str - The account identifier to target for the resource.
- hostname str
- A non-unique field that refers to a target.
- ip
Infrastructure
Access Target Ip Args - The IPv4/IPv6 address that identifies where to reach a target.
- account
Id String - The account identifier to target for the resource.
- hostname String
- A non-unique field that refers to a target.
- ip Property Map
- The IPv4/IPv6 address that identifies where to reach a target.
Outputs
All input properties are implicitly available as output properties. Additionally, the InfrastructureAccessTarget resource produces the following output properties:
- Created
At string - The date and time at which the target was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
At string - The date and time at which the target was last modified.
- Created
At string - The date and time at which the target was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
At string - The date and time at which the target was last modified.
- created
At String - The date and time at which the target was created.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
At String - The date and time at which the target was last modified.
- created
At string - The date and time at which the target was created.
- id string
- The provider-assigned unique ID for this managed resource.
- modified
At string - The date and time at which the target was last modified.
- created_
at str - The date and time at which the target was created.
- id str
- The provider-assigned unique ID for this managed resource.
- modified_
at str - The date and time at which the target was last modified.
- created
At String - The date and time at which the target was created.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
At String - The date and time at which the target was last modified.
Look up Existing InfrastructureAccessTarget Resource
Get an existing InfrastructureAccessTarget 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?: InfrastructureAccessTargetState, opts?: CustomResourceOptions): InfrastructureAccessTarget
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
created_at: Optional[str] = None,
hostname: Optional[str] = None,
ip: Optional[InfrastructureAccessTargetIpArgs] = None,
modified_at: Optional[str] = None) -> InfrastructureAccessTarget
func GetInfrastructureAccessTarget(ctx *Context, name string, id IDInput, state *InfrastructureAccessTargetState, opts ...ResourceOption) (*InfrastructureAccessTarget, error)
public static InfrastructureAccessTarget Get(string name, Input<string> id, InfrastructureAccessTargetState? state, CustomResourceOptions? opts = null)
public static InfrastructureAccessTarget get(String name, Output<String> id, InfrastructureAccessTargetState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Account
Id string - The account identifier to target for the resource.
- Created
At string - The date and time at which the target was created.
- Hostname string
- A non-unique field that refers to a target.
- Ip
Infrastructure
Access Target Ip - The IPv4/IPv6 address that identifies where to reach a target.
- Modified
At string - The date and time at which the target was last modified.
- Account
Id string - The account identifier to target for the resource.
- Created
At string - The date and time at which the target was created.
- Hostname string
- A non-unique field that refers to a target.
- Ip
Infrastructure
Access Target Ip Args - The IPv4/IPv6 address that identifies where to reach a target.
- Modified
At string - The date and time at which the target was last modified.
- account
Id String - The account identifier to target for the resource.
- created
At String - The date and time at which the target was created.
- hostname String
- A non-unique field that refers to a target.
- ip
Infrastructure
Access Target Ip - The IPv4/IPv6 address that identifies where to reach a target.
- modified
At String - The date and time at which the target was last modified.
- account
Id string - The account identifier to target for the resource.
- created
At string - The date and time at which the target was created.
- hostname string
- A non-unique field that refers to a target.
- ip
Infrastructure
Access Target Ip - The IPv4/IPv6 address that identifies where to reach a target.
- modified
At string - The date and time at which the target was last modified.
- account_
id str - The account identifier to target for the resource.
- created_
at str - The date and time at which the target was created.
- hostname str
- A non-unique field that refers to a target.
- ip
Infrastructure
Access Target Ip Args - The IPv4/IPv6 address that identifies where to reach a target.
- modified_
at str - The date and time at which the target was last modified.
- account
Id String - The account identifier to target for the resource.
- created
At String - The date and time at which the target was created.
- hostname String
- A non-unique field that refers to a target.
- ip Property Map
- The IPv4/IPv6 address that identifies where to reach a target.
- modified
At String - The date and time at which the target was last modified.
Supporting Types
InfrastructureAccessTargetIp, InfrastructureAccessTargetIpArgs
- Ipv4
Infrastructure
Access Target Ip Ipv4 - The target's IPv4 address.
- Ipv6
Infrastructure
Access Target Ip Ipv6 - The target's IPv6 address.
- Ipv4
Infrastructure
Access Target Ip Ipv4 - The target's IPv4 address.
- Ipv6
Infrastructure
Access Target Ip Ipv6 - The target's IPv6 address.
- ipv4
Infrastructure
Access Target Ip Ipv4 - The target's IPv4 address.
- ipv6
Infrastructure
Access Target Ip Ipv6 - The target's IPv6 address.
- ipv4
Infrastructure
Access Target Ip Ipv4 - The target's IPv4 address.
- ipv6
Infrastructure
Access Target Ip Ipv6 - The target's IPv6 address.
- ipv4
Infrastructure
Access Target Ip Ipv4 - The target's IPv4 address.
- ipv6
Infrastructure
Access Target Ip Ipv6 - The target's IPv6 address.
- ipv4 Property Map
- The target's IPv4 address.
- ipv6 Property Map
- The target's IPv6 address.
InfrastructureAccessTargetIpIpv4, InfrastructureAccessTargetIpIpv4Args
- Ip
Addr string - The IP address of the target.
- Virtual
Network stringId - The private virtual network identifier for the target.
- Ip
Addr string - The IP address of the target.
- Virtual
Network stringId - The private virtual network identifier for the target.
- ip
Addr String - The IP address of the target.
- virtual
Network StringId - The private virtual network identifier for the target.
- ip
Addr string - The IP address of the target.
- virtual
Network stringId - The private virtual network identifier for the target.
- ip_
addr str - The IP address of the target.
- virtual_
network_ strid - The private virtual network identifier for the target.
- ip
Addr String - The IP address of the target.
- virtual
Network StringId - The private virtual network identifier for the target.
InfrastructureAccessTargetIpIpv6, InfrastructureAccessTargetIpIpv6Args
- Ip
Addr string - The IP address of the target.
- Virtual
Network stringId - The private virtual network identifier for the target.
- Ip
Addr string - The IP address of the target.
- Virtual
Network stringId - The private virtual network identifier for the target.
- ip
Addr String - The IP address of the target.
- virtual
Network StringId - The private virtual network identifier for the target.
- ip
Addr string - The IP address of the target.
- virtual
Network stringId - The private virtual network identifier for the target.
- ip_
addr str - The IP address of the target.
- virtual_
network_ strid - The private virtual network identifier for the target.
- ip
Addr String - The IP address of the target.
- virtual
Network StringId - The private virtual network identifier for the target.
Import
$ pulumi import cloudflare:index/infrastructureAccessTarget:InfrastructureAccessTarget example <account_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.