1. Packages
  2. Control Plane (cpln)
  3. API Docs
  4. Location
Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse

cpln.Location

Explore with Pulumi AI

cpln logo
Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse

    Manages an org’s Location.

    Declaration

    Required

    • name (String) Name of the Location.
    • tags (Map of String) Key-value map of resource tags.
    • enabled (Boolean) Indication if location is enabled.

    Note You need to associate the same tags that are defined in a location; otherwise, the pulumi preview will not be empty. It is common practice to reference the tags from a location data source.

    Outputs

    • cpln_id (String) The ID, in GUID format, of the location.
    • description (String) Description of the location.
    • cloud_provider (String) Cloud Provider of the location.
    • region (String) Region of the location.
    • geo (Block List, Max: 1) (see below)
    • ip_ranges (List of String) A list of IP ranges of the location.
    • self_link (String) Full link to this resource. Can be referenced by other resources.

    geo

    Location geographical details

    • lat (Number) Latitude.
    • lon (Number) Longitude.
    • country (String) Country.
    • state (String) State.
    • city (String) City.
    • continent (String) Continent.

    Example Usage

    Reference Tags from Data Source

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cpln = Pulumi.Cpln;
    using Cpln = Pulumiverse.Cpln;
    
    return await Deployment.RunAsync(() => 
    {
        var main_location = Cpln.GetLocation.Invoke(new()
        {
            Name = "aws-eu-central-1",
        });
    
        var reference_tags_example = new Cpln.Location("reference-tags-example", new()
        {
            Enabled = true,
            Tags = main_location.Apply(main_location => main_location.Apply(getLocationResult => getLocationResult.Tags)),
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		main_location, err := cpln.LookupLocation(ctx, &cpln.LookupLocationArgs{
    			Name: "aws-eu-central-1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = cpln.NewLocation(ctx, "reference-tags-example", &cpln.LocationArgs{
    			Enabled: pulumi.Bool(true),
    			Tags:    interface{}(main_location.Tags),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cpln.CplnFunctions;
    import com.pulumi.cpln.inputs.GetLocationArgs;
    import com.pulumi.cpln.Location;
    import com.pulumi.cpln.LocationArgs;
    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) {
            final var main-location = CplnFunctions.getLocation(GetLocationArgs.builder()
                .name("aws-eu-central-1")
                .build());
    
            var reference_tags_example = new Location("reference-tags-example", LocationArgs.builder()        
                .enabled(true)
                .tags(main_location.tags())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_cpln as cpln
    import pulumiverse_cpln as cpln
    
    main_location = cpln.get_location(name="aws-eu-central-1")
    reference_tags_example = cpln.Location("reference-tags-example",
        enabled=True,
        tags=main_location.tags)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cpln from "@pulumi/cpln";
    import * as cpln from "@pulumiverse/cpln";
    
    const main-location = cpln.getLocation({
        name: "aws-eu-central-1",
    });
    const reference_tags_example = new cpln.Location("reference-tags-example", {
        enabled: true,
        tags: main_location.then(main_location => main_location.tags),
    });
    
    resources:
      reference-tags-example:
        type: cpln:Location
        properties:
          enabled: true
          tags: ${["main-location"].tags}
    variables:
      main-location:
        fn::invoke:
          Function: cpln:getLocation
          Arguments:
            name: aws-eu-central-1
    

    Hard Code Location Tags

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cpln = Pulumiverse.Cpln;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Cpln.Location("example", new()
        {
            Enabled = true,
            Tags = 
            {
                { "cpln/city", "Frankfurt" },
                { "cpln/continent", "Europe" },
                { "cpln/country", "Germany" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cpln.NewLocation(ctx, "example", &cpln.LocationArgs{
    			Enabled: pulumi.Bool(true),
    			Tags: pulumi.StringMap{
    				"cpln/city":      pulumi.String("Frankfurt"),
    				"cpln/continent": pulumi.String("Europe"),
    				"cpln/country":   pulumi.String("Germany"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cpln.Location;
    import com.pulumi.cpln.LocationArgs;
    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 Location("example", LocationArgs.builder()        
                .enabled(true)
                .tags(Map.ofEntries(
                    Map.entry("cpln/city", "Frankfurt"),
                    Map.entry("cpln/continent", "Europe"),
                    Map.entry("cpln/country", "Germany")
                ))
                .build());
    
        }
    }
    
    import pulumi
    import pulumiverse_cpln as cpln
    
    example = cpln.Location("example",
        enabled=True,
        tags={
            "cpln/city": "Frankfurt",
            "cpln/continent": "Europe",
            "cpln/country": "Germany",
        })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cpln from "@pulumiverse/cpln";
    
    const example = new cpln.Location("example", {
        enabled: true,
        tags: {
            "cpln/city": "Frankfurt",
            "cpln/continent": "Europe",
            "cpln/country": "Germany",
        },
    });
    
    resources:
      example:
        type: cpln:Location
        properties:
          enabled: true
          tags:
            cpln/city: Frankfurt
            cpln/continent: Europe
            cpln/country: Germany
    

    Create Location Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Location(name: string, args: LocationArgs, opts?: CustomResourceOptions);
    @overload
    def Location(resource_name: str,
                 args: LocationArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Location(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 enabled: Optional[bool] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 name: Optional[str] = None)
    func NewLocation(ctx *Context, name string, args LocationArgs, opts ...ResourceOption) (*Location, error)
    public Location(string name, LocationArgs args, CustomResourceOptions? opts = null)
    public Location(String name, LocationArgs args)
    public Location(String name, LocationArgs args, CustomResourceOptions options)
    
    type: cpln:Location
    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 LocationArgs
    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 LocationArgs
    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 LocationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LocationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LocationArgs
    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 locationResource = new Cpln.Location("locationResource", new()
    {
        Enabled = false,
        Tags = 
        {
            { "string", "string" },
        },
        Name = "string",
    });
    
    example, err := cpln.NewLocation(ctx, "locationResource", &cpln.LocationArgs{
    	Enabled: pulumi.Bool(false),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    })
    
    var locationResource = new Location("locationResource", LocationArgs.builder()
        .enabled(false)
        .tags(Map.of("string", "string"))
        .name("string")
        .build());
    
    location_resource = cpln.Location("locationResource",
        enabled=False,
        tags={
            "string": "string",
        },
        name="string")
    
    const locationResource = new cpln.Location("locationResource", {
        enabled: false,
        tags: {
            string: "string",
        },
        name: "string",
    });
    
    type: cpln:Location
    properties:
        enabled: false
        name: string
        tags:
            string: string
    

    Location Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Location resource accepts the following input properties:

    Enabled bool
    Indication if location is enabled.
    Tags Dictionary<string, string>
    Key-value map of resource tags.
    Name string
    Name of the Location.
    Enabled bool
    Indication if location is enabled.
    Tags map[string]string
    Key-value map of resource tags.
    Name string
    Name of the Location.
    enabled Boolean
    Indication if location is enabled.
    tags Map<String,String>
    Key-value map of resource tags.
    name String
    Name of the Location.
    enabled boolean
    Indication if location is enabled.
    tags {[key: string]: string}
    Key-value map of resource tags.
    name string
    Name of the Location.
    enabled bool
    Indication if location is enabled.
    tags Mapping[str, str]
    Key-value map of resource tags.
    name str
    Name of the Location.
    enabled Boolean
    Indication if location is enabled.
    tags Map<String>
    Key-value map of resource tags.
    name String
    Name of the Location.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Location resource produces the following output properties:

    CloudProvider string
    Cloud Provider of the location.
    CplnId string
    The ID, in GUID format, of the location.
    Description string
    Description of the location.
    Geos List<Pulumiverse.Cpln.Outputs.LocationGeo>
    Id string
    The provider-assigned unique ID for this managed resource.
    IpRanges List<string>
    A list of IP ranges of the location.
    Region string
    Region of the location.
    SelfLink string
    Full link to this resource. Can be referenced by other resources.
    CloudProvider string
    Cloud Provider of the location.
    CplnId string
    The ID, in GUID format, of the location.
    Description string
    Description of the location.
    Geos []LocationGeo
    Id string
    The provider-assigned unique ID for this managed resource.
    IpRanges []string
    A list of IP ranges of the location.
    Region string
    Region of the location.
    SelfLink string
    Full link to this resource. Can be referenced by other resources.
    cloudProvider String
    Cloud Provider of the location.
    cplnId String
    The ID, in GUID format, of the location.
    description String
    Description of the location.
    geos List<LocationGeo>
    id String
    The provider-assigned unique ID for this managed resource.
    ipRanges List<String>
    A list of IP ranges of the location.
    region String
    Region of the location.
    selfLink String
    Full link to this resource. Can be referenced by other resources.
    cloudProvider string
    Cloud Provider of the location.
    cplnId string
    The ID, in GUID format, of the location.
    description string
    Description of the location.
    geos LocationGeo[]
    id string
    The provider-assigned unique ID for this managed resource.
    ipRanges string[]
    A list of IP ranges of the location.
    region string
    Region of the location.
    selfLink string
    Full link to this resource. Can be referenced by other resources.
    cloud_provider str
    Cloud Provider of the location.
    cpln_id str
    The ID, in GUID format, of the location.
    description str
    Description of the location.
    geos Sequence[LocationGeo]
    id str
    The provider-assigned unique ID for this managed resource.
    ip_ranges Sequence[str]
    A list of IP ranges of the location.
    region str
    Region of the location.
    self_link str
    Full link to this resource. Can be referenced by other resources.
    cloudProvider String
    Cloud Provider of the location.
    cplnId String
    The ID, in GUID format, of the location.
    description String
    Description of the location.
    geos List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ipRanges List<String>
    A list of IP ranges of the location.
    region String
    Region of the location.
    selfLink String
    Full link to this resource. Can be referenced by other resources.

    Look up Existing Location Resource

    Get an existing Location 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?: LocationState, opts?: CustomResourceOptions): Location
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cloud_provider: Optional[str] = None,
            cpln_id: Optional[str] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            geos: Optional[Sequence[LocationGeoArgs]] = None,
            ip_ranges: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            self_link: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None) -> Location
    func GetLocation(ctx *Context, name string, id IDInput, state *LocationState, opts ...ResourceOption) (*Location, error)
    public static Location Get(string name, Input<string> id, LocationState? state, CustomResourceOptions? opts = null)
    public static Location get(String name, Output<String> id, LocationState 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.
    The following state arguments are supported:
    CloudProvider string
    Cloud Provider of the location.
    CplnId string
    The ID, in GUID format, of the location.
    Description string
    Description of the location.
    Enabled bool
    Indication if location is enabled.
    Geos List<Pulumiverse.Cpln.Inputs.LocationGeo>
    IpRanges List<string>
    A list of IP ranges of the location.
    Name string
    Name of the Location.
    Region string
    Region of the location.
    SelfLink string
    Full link to this resource. Can be referenced by other resources.
    Tags Dictionary<string, string>
    Key-value map of resource tags.
    CloudProvider string
    Cloud Provider of the location.
    CplnId string
    The ID, in GUID format, of the location.
    Description string
    Description of the location.
    Enabled bool
    Indication if location is enabled.
    Geos []LocationGeoArgs
    IpRanges []string
    A list of IP ranges of the location.
    Name string
    Name of the Location.
    Region string
    Region of the location.
    SelfLink string
    Full link to this resource. Can be referenced by other resources.
    Tags map[string]string
    Key-value map of resource tags.
    cloudProvider String
    Cloud Provider of the location.
    cplnId String
    The ID, in GUID format, of the location.
    description String
    Description of the location.
    enabled Boolean
    Indication if location is enabled.
    geos List<LocationGeo>
    ipRanges List<String>
    A list of IP ranges of the location.
    name String
    Name of the Location.
    region String
    Region of the location.
    selfLink String
    Full link to this resource. Can be referenced by other resources.
    tags Map<String,String>
    Key-value map of resource tags.
    cloudProvider string
    Cloud Provider of the location.
    cplnId string
    The ID, in GUID format, of the location.
    description string
    Description of the location.
    enabled boolean
    Indication if location is enabled.
    geos LocationGeo[]
    ipRanges string[]
    A list of IP ranges of the location.
    name string
    Name of the Location.
    region string
    Region of the location.
    selfLink string
    Full link to this resource. Can be referenced by other resources.
    tags {[key: string]: string}
    Key-value map of resource tags.
    cloud_provider str
    Cloud Provider of the location.
    cpln_id str
    The ID, in GUID format, of the location.
    description str
    Description of the location.
    enabled bool
    Indication if location is enabled.
    geos Sequence[LocationGeoArgs]
    ip_ranges Sequence[str]
    A list of IP ranges of the location.
    name str
    Name of the Location.
    region str
    Region of the location.
    self_link str
    Full link to this resource. Can be referenced by other resources.
    tags Mapping[str, str]
    Key-value map of resource tags.
    cloudProvider String
    Cloud Provider of the location.
    cplnId String
    The ID, in GUID format, of the location.
    description String
    Description of the location.
    enabled Boolean
    Indication if location is enabled.
    geos List<Property Map>
    ipRanges List<String>
    A list of IP ranges of the location.
    name String
    Name of the Location.
    region String
    Region of the location.
    selfLink String
    Full link to this resource. Can be referenced by other resources.
    tags Map<String>
    Key-value map of resource tags.

    Supporting Types

    LocationGeo, LocationGeoArgs

    City string
    Continent string
    Country string
    Lat double
    Lon double
    State string
    City string
    Continent string
    Country string
    Lat float64
    Lon float64
    State string
    city String
    continent String
    country String
    lat Double
    lon Double
    state String
    city string
    continent string
    country string
    lat number
    lon number
    state string
    city str
    continent str
    country str
    lat float
    lon float
    state str
    city String
    continent String
    country String
    lat Number
    lon Number
    state String

    Package Details

    Repository
    cpln pulumiverse/pulumi-cpln
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cpln Terraform Provider.
    cpln logo
    Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse