cpln.Location
Explore with Pulumi AI
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:
Outputs
All input properties are implicitly available as output properties. Additionally, the Location resource produces the following output properties:
- Cloud
Provider string - Cloud Provider of the location.
- Cpln
Id string - The ID, in GUID format, of the location.
- Description string
- Description of the location.
- Geos
List<Pulumiverse.
Cpln. Outputs. Location Geo> - Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Ranges List<string> - A list of IP ranges of the location.
- Region string
- Region of the location.
- Self
Link string - Full link to this resource. Can be referenced by other resources.
- Cloud
Provider string - Cloud Provider of the location.
- Cpln
Id string - The ID, in GUID format, of the location.
- Description string
- Description of the location.
- Geos
[]Location
Geo - Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Ranges []string - A list of IP ranges of the location.
- Region string
- Region of the location.
- Self
Link string - Full link to this resource. Can be referenced by other resources.
- cloud
Provider String - Cloud Provider of the location.
- cpln
Id String - The ID, in GUID format, of the location.
- description String
- Description of the location.
- geos
List<Location
Geo> - id String
- The provider-assigned unique ID for this managed resource.
- ip
Ranges List<String> - A list of IP ranges of the location.
- region String
- Region of the location.
- self
Link String - Full link to this resource. Can be referenced by other resources.
- cloud
Provider string - Cloud Provider of the location.
- cpln
Id string - The ID, in GUID format, of the location.
- description string
- Description of the location.
- geos
Location
Geo[] - id string
- The provider-assigned unique ID for this managed resource.
- ip
Ranges string[] - A list of IP ranges of the location.
- region string
- Region of the location.
- self
Link 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[Location
Geo] - 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.
- cloud
Provider String - Cloud Provider of the location.
- cpln
Id 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.
- ip
Ranges List<String> - A list of IP ranges of the location.
- region String
- Region of the location.
- self
Link 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.
- Cloud
Provider string - Cloud Provider of the location.
- Cpln
Id 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. Location Geo> - Ip
Ranges List<string> - A list of IP ranges of the location.
- Name string
- Name of the Location.
- Region string
- Region of the location.
- Self
Link string - Full link to this resource. Can be referenced by other resources.
- Dictionary<string, string>
- Key-value map of resource tags.
- Cloud
Provider string - Cloud Provider of the location.
- Cpln
Id string - The ID, in GUID format, of the location.
- Description string
- Description of the location.
- Enabled bool
- Indication if location is enabled.
- Geos
[]Location
Geo Args - Ip
Ranges []string - A list of IP ranges of the location.
- Name string
- Name of the Location.
- Region string
- Region of the location.
- Self
Link string - Full link to this resource. Can be referenced by other resources.
- map[string]string
- Key-value map of resource tags.
- cloud
Provider String - Cloud Provider of the location.
- cpln
Id String - The ID, in GUID format, of the location.
- description String
- Description of the location.
- enabled Boolean
- Indication if location is enabled.
- geos
List<Location
Geo> - ip
Ranges List<String> - A list of IP ranges of the location.
- name String
- Name of the Location.
- region String
- Region of the location.
- self
Link String - Full link to this resource. Can be referenced by other resources.
- Map<String,String>
- Key-value map of resource tags.
- cloud
Provider string - Cloud Provider of the location.
- cpln
Id string - The ID, in GUID format, of the location.
- description string
- Description of the location.
- enabled boolean
- Indication if location is enabled.
- geos
Location
Geo[] - ip
Ranges string[] - A list of IP ranges of the location.
- name string
- Name of the Location.
- region string
- Region of the location.
- self
Link string - Full link to this resource. Can be referenced by other resources.
- {[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[Location
Geo Args] - 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.
- Mapping[str, str]
- Key-value map of resource tags.
- cloud
Provider String - Cloud Provider of the location.
- cpln
Id 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>
- ip
Ranges List<String> - A list of IP ranges of the location.
- name String
- Name of the Location.
- region String
- Region of the location.
- self
Link String - Full link to this resource. Can be referenced by other resources.
- Map<String>
- Key-value map of resource tags.
Supporting Types
LocationGeo, LocationGeoArgs
Package Details
- Repository
- cpln pulumiverse/pulumi-cpln
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cpln
Terraform Provider.