User Workloads Secret Args
data class UserWorkloadsSecretArgs(val data: Output<Map<String, String>>? = null, val environment: Output<String>? = null, val name: Output<String>? = null, val project: Output<String>? = null, val region: Output<String>? = null) : ConvertibleToJava<UserWorkloadsSecretArgs>
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as std from "@pulumi/std";
const example = new gcp.composer.Environment("example", {
name: "example-environment",
project: "example-project",
region: "us-central1",
config: {
softwareConfig: {
imageVersion: "example-image-version",
},
},
});
const exampleUserWorkloadsSecret = new gcp.composer.UserWorkloadsSecret("example", {
name: "example-secret",
project: "example-project",
region: "us-central1",
environment: example.name,
data: {
email: std.base64encode({
input: "example-email",
}).then(invoke => invoke.result),
password: std.base64encode({
input: "example-password",
}).then(invoke => invoke.result),
},
});
Content copied to clipboard
import pulumi
import pulumi_gcp as gcp
import pulumi_std as std
example = gcp.composer.Environment("example",
name="example-environment",
project="example-project",
region="us-central1",
config={
"software_config": {
"image_version": "example-image-version",
},
})
example_user_workloads_secret = gcp.composer.UserWorkloadsSecret("example",
name="example-secret",
project="example-project",
region="us-central1",
environment=example.name,
data={
"email": std.base64encode(input="example-email").result,
"password": std.base64encode(input="example-password").result,
})
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = new Gcp.Composer.Environment("example", new()
{
Name = "example-environment",
Project = "example-project",
Region = "us-central1",
Config = new Gcp.Composer.Inputs.EnvironmentConfigArgs
{
SoftwareConfig = new Gcp.Composer.Inputs.EnvironmentConfigSoftwareConfigArgs
{
ImageVersion = "example-image-version",
},
},
});
var exampleUserWorkloadsSecret = new Gcp.Composer.UserWorkloadsSecret("example", new()
{
Name = "example-secret",
Project = "example-project",
Region = "us-central1",
Environment = example.Name,
Data =
{
{ "email", Std.Base64encode.Invoke(new()
{
Input = "example-email",
}).Apply(invoke => invoke.Result) },
{ "password", Std.Base64encode.Invoke(new()
{
Input = "example-password",
}).Apply(invoke => invoke.Result) },
},
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/composer"
"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 {
example, err := composer.NewEnvironment(ctx, "example", &composer.EnvironmentArgs{
Name: pulumi.String("example-environment"),
Project: pulumi.String("example-project"),
Region: pulumi.String("us-central1"),
Config: &composer.EnvironmentConfigArgs{
SoftwareConfig: &composer.EnvironmentConfigSoftwareConfigArgs{
ImageVersion: pulumi.String("example-image-version"),
},
},
})
if err != nil {
return err
}
invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
Input: "example-email",
}, nil)
if err != nil {
return err
}
invokeBase64encode1, err := std.Base64encode(ctx, &std.Base64encodeArgs{
Input: "example-password",
}, nil)
if err != nil {
return err
}
_, err = composer.NewUserWorkloadsSecret(ctx, "example", &composer.UserWorkloadsSecretArgs{
Name: pulumi.String("example-secret"),
Project: pulumi.String("example-project"),
Region: pulumi.String("us-central1"),
Environment: example.Name,
Data: pulumi.StringMap{
"email": pulumi.String(invokeBase64encode.Result),
"password": pulumi.String(invokeBase64encode1.Result),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.composer.Environment;
import com.pulumi.gcp.composer.EnvironmentArgs;
import com.pulumi.gcp.composer.inputs.EnvironmentConfigArgs;
import com.pulumi.gcp.composer.inputs.EnvironmentConfigSoftwareConfigArgs;
import com.pulumi.gcp.composer.UserWorkloadsSecret;
import com.pulumi.gcp.composer.UserWorkloadsSecretArgs;
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 Environment("example", EnvironmentArgs.builder()
.name("example-environment")
.project("example-project")
.region("us-central1")
.config(EnvironmentConfigArgs.builder()
.softwareConfig(EnvironmentConfigSoftwareConfigArgs.builder()
.imageVersion("example-image-version")
.build())
.build())
.build());
var exampleUserWorkloadsSecret = new UserWorkloadsSecret("exampleUserWorkloadsSecret", UserWorkloadsSecretArgs.builder()
.name("example-secret")
.project("example-project")
.region("us-central1")
.environment(example.name())
.data(Map.ofEntries(
Map.entry("email", StdFunctions.base64encode(Base64encodeArgs.builder()
.input("example-email")
.build()).result()),
Map.entry("password", StdFunctions.base64encode(Base64encodeArgs.builder()
.input("example-password")
.build()).result())
))
.build());
}
}
Content copied to clipboard
resources:
example:
type: gcp:composer:Environment
properties:
name: example-environment
project: example-project
region: us-central1
config:
softwareConfig:
imageVersion: example-image-version
exampleUserWorkloadsSecret:
type: gcp:composer:UserWorkloadsSecret
name: example
properties:
name: example-secret
project: example-project
region: us-central1
environment: ${example.name}
data:
email:
fn::invoke:
Function: std:base64encode
Arguments:
input: example-email
Return: result
password:
fn::invoke:
Function: std:base64encode
Arguments:
input: example-password
Return: result
Content copied to clipboard
Import
Secret can be imported using any of these accepted formats:
projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsSecrets/{{name}}
{{project}}/{{region}}/{{environment}}/{{name}}
{{environment}}/{{name}}
When using thepulumi import
command, Environment can be imported using one of the formats above. For example:
$ pulumi import gcp:composer/userWorkloadsSecret:UserWorkloadsSecret example projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsSecrets/{{name}}
Content copied to clipboard
$ pulumi import gcp:composer/userWorkloadsSecret:UserWorkloadsSecret example {{project}}/{{region}}/{{environment}}/{{name}}
Content copied to clipboard
$ pulumi import gcp:composer/userWorkloadsSecret:UserWorkloadsSecret example {{environment}}/{{name}}
Content copied to clipboard