harness.cloudprovider.Datacenter
Explore with Pulumi AI
Resource for creating a physical data center cloud provider. This resource uses the config-as-code API’s. When updating the name
or path
of this resource you should typically also set the create_before_destroy = true
lifecycle setting.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
const example = new harness.cloudprovider.Datacenter("example", {name: "example"});
import pulumi
import pulumi_harness as harness
example = harness.cloudprovider.Datacenter("example", name="example")
package main
import (
"github.com/pulumi/pulumi-harness/sdk/go/harness/cloudprovider"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudprovider.NewDatacenter(ctx, "example", &cloudprovider.DatacenterArgs{
Name: pulumi.String("example"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;
return await Deployment.RunAsync(() =>
{
var example = new Harness.Cloudprovider.Datacenter("example", new()
{
Name = "example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.cloudprovider.Datacenter;
import com.pulumi.harness.cloudprovider.DatacenterArgs;
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 Datacenter("example", DatacenterArgs.builder()
.name("example")
.build());
}
}
resources:
example:
type: harness:cloudprovider:Datacenter
properties:
name: example
Create Datacenter Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Datacenter(name: string, args?: DatacenterArgs, opts?: CustomResourceOptions);
@overload
def Datacenter(resource_name: str,
args: Optional[DatacenterArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Datacenter(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
usage_scopes: Optional[Sequence[DatacenterUsageScopeArgs]] = None)
func NewDatacenter(ctx *Context, name string, args *DatacenterArgs, opts ...ResourceOption) (*Datacenter, error)
public Datacenter(string name, DatacenterArgs? args = null, CustomResourceOptions? opts = null)
public Datacenter(String name, DatacenterArgs args)
public Datacenter(String name, DatacenterArgs args, CustomResourceOptions options)
type: harness:cloudprovider:Datacenter
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 DatacenterArgs
- 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 DatacenterArgs
- 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 DatacenterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatacenterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatacenterArgs
- 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 datacenterResource = new Harness.Cloudprovider.Datacenter("datacenterResource", new()
{
Name = "string",
UsageScopes = new[]
{
new Harness.Cloudprovider.Inputs.DatacenterUsageScopeArgs
{
ApplicationId = "string",
EnvironmentFilterType = "string",
EnvironmentId = "string",
},
},
});
example, err := cloudprovider.NewDatacenter(ctx, "datacenterResource", &cloudprovider.DatacenterArgs{
Name: pulumi.String("string"),
UsageScopes: cloudprovider.DatacenterUsageScopeArray{
&cloudprovider.DatacenterUsageScopeArgs{
ApplicationId: pulumi.String("string"),
EnvironmentFilterType: pulumi.String("string"),
EnvironmentId: pulumi.String("string"),
},
},
})
var datacenterResource = new Datacenter("datacenterResource", DatacenterArgs.builder()
.name("string")
.usageScopes(DatacenterUsageScopeArgs.builder()
.applicationId("string")
.environmentFilterType("string")
.environmentId("string")
.build())
.build());
datacenter_resource = harness.cloudprovider.Datacenter("datacenterResource",
name="string",
usage_scopes=[{
"application_id": "string",
"environment_filter_type": "string",
"environment_id": "string",
}])
const datacenterResource = new harness.cloudprovider.Datacenter("datacenterResource", {
name: "string",
usageScopes: [{
applicationId: "string",
environmentFilterType: "string",
environmentId: "string",
}],
});
type: harness:cloudprovider:Datacenter
properties:
name: string
usageScopes:
- applicationId: string
environmentFilterType: string
environmentId: string
Datacenter 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 Datacenter resource accepts the following input properties:
- Name string
- The name of the cloud provider.
- Usage
Scopes List<DatacenterUsage Scope> - This block is used for scoping the resource to a specific set of applications or environments.
- Name string
- The name of the cloud provider.
- Usage
Scopes []DatacenterUsage Scope Args - This block is used for scoping the resource to a specific set of applications or environments.
- name String
- The name of the cloud provider.
- usage
Scopes List<DatacenterUsage Scope> - This block is used for scoping the resource to a specific set of applications or environments.
- name string
- The name of the cloud provider.
- usage
Scopes DatacenterUsage Scope[] - This block is used for scoping the resource to a specific set of applications or environments.
- name str
- The name of the cloud provider.
- usage_
scopes Sequence[DatacenterUsage Scope Args] - This block is used for scoping the resource to a specific set of applications or environments.
- name String
- The name of the cloud provider.
- usage
Scopes List<Property Map> - This block is used for scoping the resource to a specific set of applications or environments.
Outputs
All input properties are implicitly available as output properties. Additionally, the Datacenter 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 Datacenter Resource
Get an existing Datacenter 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?: DatacenterState, opts?: CustomResourceOptions): Datacenter
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
usage_scopes: Optional[Sequence[DatacenterUsageScopeArgs]] = None) -> Datacenter
func GetDatacenter(ctx *Context, name string, id IDInput, state *DatacenterState, opts ...ResourceOption) (*Datacenter, error)
public static Datacenter Get(string name, Input<string> id, DatacenterState? state, CustomResourceOptions? opts = null)
public static Datacenter get(String name, Output<String> id, DatacenterState 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.
- Name string
- The name of the cloud provider.
- Usage
Scopes List<DatacenterUsage Scope> - This block is used for scoping the resource to a specific set of applications or environments.
- Name string
- The name of the cloud provider.
- Usage
Scopes []DatacenterUsage Scope Args - This block is used for scoping the resource to a specific set of applications or environments.
- name String
- The name of the cloud provider.
- usage
Scopes List<DatacenterUsage Scope> - This block is used for scoping the resource to a specific set of applications or environments.
- name string
- The name of the cloud provider.
- usage
Scopes DatacenterUsage Scope[] - This block is used for scoping the resource to a specific set of applications or environments.
- name str
- The name of the cloud provider.
- usage_
scopes Sequence[DatacenterUsage Scope Args] - This block is used for scoping the resource to a specific set of applications or environments.
- name String
- The name of the cloud provider.
- usage
Scopes List<Property Map> - This block is used for scoping the resource to a specific set of applications or environments.
Supporting Types
DatacenterUsageScope, DatacenterUsageScopeArgs
- Application
Id string - Id of the application to scope to. If empty then this scope applies to all applications.
- Environment
Filter stringType - Type of environment filter applied. Cannot be used with
environment_id
. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS. - Environment
Id string - Id of the id of the specific environment to scope to. Cannot be used with
environment_filter_type
.
- Application
Id string - Id of the application to scope to. If empty then this scope applies to all applications.
- Environment
Filter stringType - Type of environment filter applied. Cannot be used with
environment_id
. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS. - Environment
Id string - Id of the id of the specific environment to scope to. Cannot be used with
environment_filter_type
.
- application
Id String - Id of the application to scope to. If empty then this scope applies to all applications.
- environment
Filter StringType - Type of environment filter applied. Cannot be used with
environment_id
. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS. - environment
Id String - Id of the id of the specific environment to scope to. Cannot be used with
environment_filter_type
.
- application
Id string - Id of the application to scope to. If empty then this scope applies to all applications.
- environment
Filter stringType - Type of environment filter applied. Cannot be used with
environment_id
. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS. - environment
Id string - Id of the id of the specific environment to scope to. Cannot be used with
environment_filter_type
.
- application_
id str - Id of the application to scope to. If empty then this scope applies to all applications.
- environment_
filter_ strtype - Type of environment filter applied. Cannot be used with
environment_id
. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS. - environment_
id str - Id of the id of the specific environment to scope to. Cannot be used with
environment_filter_type
.
- application
Id String - Id of the application to scope to. If empty then this scope applies to all applications.
- environment
Filter StringType - Type of environment filter applied. Cannot be used with
environment_id
. Valid options are NONPRODUCTIONENVIRONMENTS, PRODUCTION_ENVIRONMENTS. - environment
Id String - Id of the id of the specific environment to scope to. Cannot be used with
environment_filter_type
.
Import
Import using the Harness datacenter cloud provider id.
$ pulumi import harness:cloudprovider/datacenter:Datacenter example <provider_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harness
Terraform Provider.