DeploymentType class
A collection of resources that are deployed and managed together using a configuration file
> Warning: This resource is intended only to manage a Deployment resource, and attempts to manage the Deployment's resources in the provider as well will likely result in errors or unexpected behavior as the two tools fight over ownership. We strongly discourage doing so unless you are an experienced user of both tools.
In addition, due to limitations of the API, the provider will treat
deployments in preview as recreate-only for any update operation other
than actually deploying an in-preview deployment (i.e. preview=true to
preview=false).
Example Usage
Deployment Manager Deployment Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as std from "@pulumi/std";
const deployment = new gcp.deploymentmanager.Deployment("deployment", {
name: "my-deployment",
target: {
config: {
content: std.file({
input: "path/to/config.yml",
}).then(invoke => invoke.result),
},
},
labels: [{
key: "foo",
value: "bar",
}],
});
import pulumi
import pulumi_gcp as gcp
import pulumi_std as std
deployment = gcp.deploymentmanager.Deployment("deployment",
name="my-deployment",
target={
"config": {
"content": std.file(input="path/to/config.yml").result,
},
},
labels=[{
"key": "foo",
"value": "bar",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var deployment = new Gcp.DeploymentManager.Deployment("deployment", new()
{
Name = "my-deployment",
Target = new Gcp.DeploymentManager.Inputs.DeploymentTargetArgs
{
Config = new Gcp.DeploymentManager.Inputs.DeploymentTargetConfigArgs
{
Content = Std.File.Invoke(new()
{
Input = "path/to/config.yml",
}).Apply(invoke => invoke.Result),
},
},
Labels = new[]
{
new Gcp.DeploymentManager.Inputs.DeploymentLabelArgs
{
Key = "foo",
Value = "bar",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/deploymentmanager"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "path/to/config.yml",
}, nil)
if err != nil {
return err
}
_, err = deploymentmanager.NewDeployment(ctx, "deployment", &deploymentmanager.DeploymentArgs{
Name: pulumi.String("my-deployment"),
Target: &deploymentmanager.DeploymentTargetArgs{
Config: &deploymentmanager.DeploymentTargetConfigArgs{
Content: pulumi.String(invokeFile.Result),
},
},
Labels: deploymentmanager.DeploymentLabelArray{
&deploymentmanager.DeploymentLabelArgs{
Key: pulumi.String("foo"),
Value: pulumi.String("bar"),
},
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
std = {
source = "pulumi/std"
}
}
}
resource "gcp_deploymentmanager_deployment" "deployment" {
name = "my-deployment"
target = {
config = {
content = file("path/to/config.yml")
}
}
labels {
key = "foo"
value = "bar"
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.deploymentmanager.Deployment;
import com.pulumi.gcp.deploymentmanager.DeploymentArgs;
import com.pulumi.gcp.deploymentmanager.inputs.DeploymentTargetArgs;
import com.pulumi.gcp.deploymentmanager.inputs.DeploymentTargetConfigArgs;
import com.pulumi.gcp.deploymentmanager.inputs.DeploymentLabelArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.FileArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 deployment = new Deployment("deployment", DeploymentArgs.builder()
.name("my-deployment")
.target(DeploymentTargetArgs.builder()
.config(DeploymentTargetConfigArgs.builder()
.content(StdFunctions.file(FileArgs.builder()
.input("path/to/config.yml")
.build()).result())
.build())
.build())
.labels(DeploymentLabelArgs.builder()
.key("foo")
.value("bar")
.build())
.build());
}
}
resources:
deployment:
type: gcp:deploymentmanager:Deployment
properties:
name: my-deployment
target:
config:
content:
fn::invoke:
function: std:file
arguments:
input: path/to/config.yml
return: result
labels:
- key: foo
value: bar
Import
Deployment can be imported using any of these accepted formats:
projects/{{project}}/deployments/{{name}}{{project}}/{{name}}{{name}}
When using the pulumi import command, Deployment can be imported using one of the formats above. For example:
$ pulumi import gcp:deploymentmanager/deployment:Deployment default projects/{{project}}/deployments/{{name}}
$ pulumi import gcp:deploymentmanager/deployment:Deployment default {{project}}/{{name}}
$ pulumi import gcp:deploymentmanager/deployment:Deployment default {{name}}
Constructors
- DeploymentType(String name, {DeploymentArgs? args, CustomResourceOptions? options})
-
Creates a new DeploymentType.
nameThe Pulumi resource name.argsArguments used to configure this DeploymentType. The set of arguments for Deployment.optionsResource options controlling this resource's behavior. - DeploymentType.reference(String urn)
- Creates a typed reference to an existing DeploymentType resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createPolicy
↔ Output<
String?> -
Set the policy to use for creating new resources. Only used on
create and update. Valid values are
CREATE_OR_ACQUIRE(default) orACQUIRE. If set toACQUIREand resources do not already exist, the deployment will fail. Note that updating this field does not actually affect the deployment, just how it is updated. Default value isCREATE_OR_ACQUIRE. Possible values are:ACQUIRE,CREATE_OR_ACQUIRE.latefinal -
deletePolicy
↔ Output<
String?> -
Set the policy to use for deleting new resources on update/delete.
Valid values are
DELETE(default) orABANDON. IfDELETE, resource is deleted after removal from Deployment Manager. IfABANDON, the resource is only removed from Deployment Manager and is not actually deleted. Note that updating this field does not actually change the deployment, just how it is updated. Default value isDELETE. Possible values are:ABANDON,DELETE.latefinal -
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
-
deploymentId
↔ Output<
String> -
Unique identifier for deployment. Output only.
latefinal
-
description
↔ Output<
String?> -
Optional user-provided description of deployment.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
labels
↔ Output<
List< DeploymentLabel> ?> -
Key-value pairs to apply to this labels.
Structure is documented below.
latefinal
-
manifest
↔ Output<
String> -
Output only. URL of the manifest representing the last manifest that
was successfully deployed.
latefinal
-
name
↔ Output<
String> -
Unique name for the deployment
latefinal
-
preview
↔ Output<
bool?> -
If set to true, a deployment is created with "shell" resources
that are not actually instantiated. This allows you to preview a
deployment. It can be updated to false to actually deploy
with real resources.
~>NOTE: Deployment Manager does not allow update
of a deployment in preview (unless updating to preview=false). Thus,
the provider will force-recreate deployments if either preview is updated
to true or if other fields are updated while preview is true.
latefinal
-
project
↔ Output<
String> -
The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selfLink
↔ Output<
String> -
Output only. Server defined URL for the resource.
latefinal
-
target
↔ Output<
DeploymentTarget> -
Parameters that define your deployment, including the deployment
configuration and relevant templates.
Structure is documented below.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {DeploymentState? state, CustomResourceOptions? options}) → DeploymentType -
Gets an existing DeploymentType resource's state with the given
nameandid.