ec logo
ElasticCloud (EC) v0.5.1, Feb 17 23

ec.DeploymentElasticsearchKeystore

Attributes reference

There are no additional attributes exported by this resource other than the referenced arguments.

Example Usage

Adding a new keystore setting to your deployment

using System.Collections.Generic;
using Pulumi;
using ElasticCloud = Pulumi.ElasticCloud;

return await Deployment.RunAsync(() => 
{
    var latest = ElasticCloud.GetStack.Invoke(new()
    {
        VersionRegex = "latest",
        Region = "us-east-1",
    });

    // Create an Elastic Cloud deployment
    var exampleKeystore = new ElasticCloud.Deployment("exampleKeystore", new()
    {
        Region = "us-east-1",
        Version = latest.Apply(getStackResult => getStackResult.Version),
        DeploymentTemplateId = "aws-io-optimized-v2",
        Elasticsearch = null,
    });

    // Create the keystore secret entry
    var secureUrl = new ElasticCloud.DeploymentElasticsearchKeystore("secureUrl", new()
    {
        DeploymentId = exampleKeystore.Id,
        SettingName = "xpack.notification.slack.account.hello.secure_url",
        Value = "http://my-secure-url.com",
    });

});
package main

import (
	"github.com/pulumi/pulumi-ec/sdk/go/ec"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		latest, err := ec.GetStack(ctx, &ec.GetStackArgs{
			VersionRegex: "latest",
			Region:       "us-east-1",
		}, nil)
		if err != nil {
			return err
		}
		exampleKeystore, err := ec.NewDeployment(ctx, "exampleKeystore", &ec.DeploymentArgs{
			Region:               pulumi.String("us-east-1"),
			Version:              *pulumi.String(latest.Version),
			DeploymentTemplateId: pulumi.String("aws-io-optimized-v2"),
			Elasticsearch:        nil,
		})
		if err != nil {
			return err
		}
		_, err = ec.NewDeploymentElasticsearchKeystore(ctx, "secureUrl", &ec.DeploymentElasticsearchKeystoreArgs{
			DeploymentId: exampleKeystore.ID(),
			SettingName:  pulumi.String("xpack.notification.slack.account.hello.secure_url"),
			Value:        pulumi.String("http://my-secure-url.com"),
		})
		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.ec.EcFunctions;
import com.pulumi.ec.inputs.GetStackArgs;
import com.pulumi.ec.Deployment;
import com.pulumi.ec.DeploymentArgs;
import com.pulumi.ec.inputs.DeploymentElasticsearchArgs;
import com.pulumi.ec.DeploymentElasticsearchKeystore;
import com.pulumi.ec.DeploymentElasticsearchKeystoreArgs;
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 latest = EcFunctions.getStack(GetStackArgs.builder()
            .versionRegex("latest")
            .region("us-east-1")
            .build());

        var exampleKeystore = new Deployment("exampleKeystore", DeploymentArgs.builder()        
            .region("us-east-1")
            .version(latest.applyValue(getStackResult -> getStackResult.version()))
            .deploymentTemplateId("aws-io-optimized-v2")
            .elasticsearch()
            .build());

        var secureUrl = new DeploymentElasticsearchKeystore("secureUrl", DeploymentElasticsearchKeystoreArgs.builder()        
            .deploymentId(exampleKeystore.id())
            .settingName("xpack.notification.slack.account.hello.secure_url")
            .value("http://my-secure-url.com")
            .build());

    }
}
import pulumi
import pulumi_ec as ec

latest = ec.get_stack(version_regex="latest",
    region="us-east-1")
# Create an Elastic Cloud deployment
example_keystore = ec.Deployment("exampleKeystore",
    region="us-east-1",
    version=latest.version,
    deployment_template_id="aws-io-optimized-v2",
    elasticsearch=ec.DeploymentElasticsearchArgs())
# Create the keystore secret entry
secure_url = ec.DeploymentElasticsearchKeystore("secureUrl",
    deployment_id=example_keystore.id,
    setting_name="xpack.notification.slack.account.hello.secure_url",
    value="http://my-secure-url.com")
import * as pulumi from "@pulumi/pulumi";
import * as ec from "@pulumi/ec";

const latest = ec.getStack({
    versionRegex: "latest",
    region: "us-east-1",
});
// Create an Elastic Cloud deployment
const exampleKeystore = new ec.Deployment("exampleKeystore", {
    region: "us-east-1",
    version: latest.then(latest => latest.version),
    deploymentTemplateId: "aws-io-optimized-v2",
    elasticsearch: {},
});
// Create the keystore secret entry
const secureUrl = new ec.DeploymentElasticsearchKeystore("secureUrl", {
    deploymentId: exampleKeystore.id,
    settingName: "xpack.notification.slack.account.hello.secure_url",
    value: "http://my-secure-url.com",
});
resources:
  # Create an Elastic Cloud deployment
  exampleKeystore:
    type: ec:Deployment
    properties:
      region: us-east-1
      version: ${latest.version}
      deploymentTemplateId: aws-io-optimized-v2
      elasticsearch: {}
  # Create the keystore secret entry
  secureUrl:
    type: ec:DeploymentElasticsearchKeystore
    properties:
      deploymentId: ${exampleKeystore.id}
      settingName: xpack.notification.slack.account.hello.secure_url
      value: http://my-secure-url.com
variables:
  latest:
    fn::invoke:
      Function: ec:getStack
      Arguments:
        versionRegex: latest
        region: us-east-1

Adding credentials to use GCS as a snapshot repository

using System.Collections.Generic;
using System.IO;
using Pulumi;
using ElasticCloud = Pulumi.ElasticCloud;

return await Deployment.RunAsync(() => 
{
    var latest = ElasticCloud.GetStack.Invoke(new()
    {
        VersionRegex = "latest",
        Region = "us-east-1",
    });

    // Create an Elastic Cloud deployment
    var exampleKeystore = new ElasticCloud.Deployment("exampleKeystore", new()
    {
        Region = "us-east-1",
        Version = latest.Apply(getStackResult => getStackResult.Version),
        DeploymentTemplateId = "aws-io-optimized-v2",
        Elasticsearch = null,
    });

    // Create the keystore secret entry
    var gcsCredential = new ElasticCloud.DeploymentElasticsearchKeystore("gcsCredential", new()
    {
        DeploymentId = exampleKeystore.Id,
        SettingName = "gcs.client.default.credentials_file",
        Value = File.ReadAllText("service-account-key.json"),
        AsFile = true,
    });

});
package main

import (
	"os"

	"github.com/pulumi/pulumi-ec/sdk/go/ec"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := os.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		latest, err := ec.GetStack(ctx, &ec.GetStackArgs{
			VersionRegex: "latest",
			Region:       "us-east-1",
		}, nil)
		if err != nil {
			return err
		}
		exampleKeystore, err := ec.NewDeployment(ctx, "exampleKeystore", &ec.DeploymentArgs{
			Region:               pulumi.String("us-east-1"),
			Version:              *pulumi.String(latest.Version),
			DeploymentTemplateId: pulumi.String("aws-io-optimized-v2"),
			Elasticsearch:        nil,
		})
		if err != nil {
			return err
		}
		_, err = ec.NewDeploymentElasticsearchKeystore(ctx, "gcsCredential", &ec.DeploymentElasticsearchKeystoreArgs{
			DeploymentId: exampleKeystore.ID(),
			SettingName:  pulumi.String("gcs.client.default.credentials_file"),
			Value:        readFileOrPanic("service-account-key.json"),
			AsFile:       pulumi.Bool(true),
		})
		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.ec.EcFunctions;
import com.pulumi.ec.inputs.GetStackArgs;
import com.pulumi.ec.Deployment;
import com.pulumi.ec.DeploymentArgs;
import com.pulumi.ec.inputs.DeploymentElasticsearchArgs;
import com.pulumi.ec.DeploymentElasticsearchKeystore;
import com.pulumi.ec.DeploymentElasticsearchKeystoreArgs;
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 latest = EcFunctions.getStack(GetStackArgs.builder()
            .versionRegex("latest")
            .region("us-east-1")
            .build());

        var exampleKeystore = new Deployment("exampleKeystore", DeploymentArgs.builder()        
            .region("us-east-1")
            .version(latest.applyValue(getStackResult -> getStackResult.version()))
            .deploymentTemplateId("aws-io-optimized-v2")
            .elasticsearch()
            .build());

        var gcsCredential = new DeploymentElasticsearchKeystore("gcsCredential", DeploymentElasticsearchKeystoreArgs.builder()        
            .deploymentId(exampleKeystore.id())
            .settingName("gcs.client.default.credentials_file")
            .value(Files.readString(Paths.get("service-account-key.json")))
            .asFile(true)
            .build());

    }
}
import pulumi
import pulumi_ec as ec

latest = ec.get_stack(version_regex="latest",
    region="us-east-1")
# Create an Elastic Cloud deployment
example_keystore = ec.Deployment("exampleKeystore",
    region="us-east-1",
    version=latest.version,
    deployment_template_id="aws-io-optimized-v2",
    elasticsearch=ec.DeploymentElasticsearchArgs())
# Create the keystore secret entry
gcs_credential = ec.DeploymentElasticsearchKeystore("gcsCredential",
    deployment_id=example_keystore.id,
    setting_name="gcs.client.default.credentials_file",
    value=(lambda path: open(path).read())("service-account-key.json"),
    as_file=True)
import * as pulumi from "@pulumi/pulumi";
import * as ec from "@pulumi/ec";
import * as fs from "fs";

const latest = ec.getStack({
    versionRegex: "latest",
    region: "us-east-1",
});
// Create an Elastic Cloud deployment
const exampleKeystore = new ec.Deployment("exampleKeystore", {
    region: "us-east-1",
    version: latest.then(latest => latest.version),
    deploymentTemplateId: "aws-io-optimized-v2",
    elasticsearch: {},
});
// Create the keystore secret entry
const gcsCredential = new ec.DeploymentElasticsearchKeystore("gcsCredential", {
    deploymentId: exampleKeystore.id,
    settingName: "gcs.client.default.credentials_file",
    value: fs.readFileSync("service-account-key.json"),
    asFile: true,
});
resources:
  # Create an Elastic Cloud deployment
  exampleKeystore:
    type: ec:Deployment
    properties:
      region: us-east-1
      version: ${latest.version}
      deploymentTemplateId: aws-io-optimized-v2
      elasticsearch: {}
  # Create the keystore secret entry
  gcsCredential:
    type: ec:DeploymentElasticsearchKeystore
    properties:
      deploymentId: ${exampleKeystore.id}
      settingName: gcs.client.default.credentials_file
      value:
        fn::readFile: service-account-key.json
      asFile: true
variables:
  latest:
    fn::invoke:
      Function: ec:getStack
      Arguments:
        versionRegex: latest
        region: us-east-1

Create DeploymentElasticsearchKeystore Resource

new DeploymentElasticsearchKeystore(name: string, args: DeploymentElasticsearchKeystoreArgs, opts?: CustomResourceOptions);
@overload
def DeploymentElasticsearchKeystore(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    as_file: Optional[bool] = None,
                                    deployment_id: Optional[str] = None,
                                    setting_name: Optional[str] = None,
                                    value: Optional[str] = None)
@overload
def DeploymentElasticsearchKeystore(resource_name: str,
                                    args: DeploymentElasticsearchKeystoreArgs,
                                    opts: Optional[ResourceOptions] = None)
func NewDeploymentElasticsearchKeystore(ctx *Context, name string, args DeploymentElasticsearchKeystoreArgs, opts ...ResourceOption) (*DeploymentElasticsearchKeystore, error)
public DeploymentElasticsearchKeystore(string name, DeploymentElasticsearchKeystoreArgs args, CustomResourceOptions? opts = null)
public DeploymentElasticsearchKeystore(String name, DeploymentElasticsearchKeystoreArgs args)
public DeploymentElasticsearchKeystore(String name, DeploymentElasticsearchKeystoreArgs args, CustomResourceOptions options)
type: ec:DeploymentElasticsearchKeystore
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DeploymentElasticsearchKeystoreArgs
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 DeploymentElasticsearchKeystoreArgs
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 DeploymentElasticsearchKeystoreArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DeploymentElasticsearchKeystoreArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DeploymentElasticsearchKeystoreArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

DeploymentElasticsearchKeystore 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 DeploymentElasticsearchKeystore resource accepts the following input properties:

DeploymentId string

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

SettingName string

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

Value string

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

AsFile bool

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

DeploymentId string

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

SettingName string

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

Value string

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

AsFile bool

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

deploymentId String

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

settingName String

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

value String

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

asFile Boolean

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

deploymentId string

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

settingName string

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

value string

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

asFile boolean

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

deployment_id str

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

setting_name str

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

value str

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

as_file bool

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

deploymentId String

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

settingName String

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

value String

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

asFile Boolean

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

Outputs

All input properties are implicitly available as output properties. Additionally, the DeploymentElasticsearchKeystore 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 DeploymentElasticsearchKeystore Resource

Get an existing DeploymentElasticsearchKeystore 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?: DeploymentElasticsearchKeystoreState, opts?: CustomResourceOptions): DeploymentElasticsearchKeystore
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        as_file: Optional[bool] = None,
        deployment_id: Optional[str] = None,
        setting_name: Optional[str] = None,
        value: Optional[str] = None) -> DeploymentElasticsearchKeystore
func GetDeploymentElasticsearchKeystore(ctx *Context, name string, id IDInput, state *DeploymentElasticsearchKeystoreState, opts ...ResourceOption) (*DeploymentElasticsearchKeystore, error)
public static DeploymentElasticsearchKeystore Get(string name, Input<string> id, DeploymentElasticsearchKeystoreState? state, CustomResourceOptions? opts = null)
public static DeploymentElasticsearchKeystore get(String name, Output<String> id, DeploymentElasticsearchKeystoreState 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:
AsFile bool

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

DeploymentId string

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

SettingName string

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

Value string

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

AsFile bool

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

DeploymentId string

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

SettingName string

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

Value string

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

asFile Boolean

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

deploymentId String

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

settingName String

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

value String

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

asFile boolean

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

deploymentId string

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

settingName string

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

value string

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

as_file bool

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

deployment_id str

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

setting_name str

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

value str

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

asFile Boolean

if set to true, it stores the remote keystore setting as a file. The default value is false, which stores the keystore setting as string when value is a plain string.

deploymentId String

Deployment ID of the deployment that holds the Elasticsearch cluster where the keystore setting is written to.

settingName String

Required name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.

value String

Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.

Import

This resource cannot be imported.

Package Details

Repository
ec pulumi/pulumi-ec
License
Apache-2.0
Notes

This Pulumi package is based on the ec Terraform Provider.