ec.DeploymentExtension
Import
You can import extensions using the id
, for example
$ pulumi import ec:index/deploymentExtension:DeploymentExtension name 320b7b540dfc967a7a649c18e2fce4ed
Example Usage
With extension file
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using Pulumi;
using ElasticCloud = Pulumi.ElasticCloud;
private static string ComputeFileBase64Sha256(string path) {
var fileData = Encoding.UTF8.GetBytes(File.ReadAllText(path));
var hashData = SHA256.Create().ComputeHash(fileData);
return Convert.ToBase64String(hashData);
}
return await Deployment.RunAsync(() =>
{
var filePath = "/path/to/plugin.zip";
var exampleExtension = new ElasticCloud.DeploymentExtension("exampleExtension", new()
{
Description = "my extension",
Version = "*",
ExtensionType = "bundle",
FilePath = filePath,
FileHash = ComputeFileBase64Sha256(filePath),
});
});
package main
import (
"crypto/sha256"
"fmt"
"os"
"github.com/pulumi/pulumi-ec/sdk/go/ec"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func filebase64sha256OrPanic(path string) pulumi.StringPtrInput {
if fileData, err := os.ReadFile(path); err == nil {
hashedData := sha256.Sum256([]byte(fileData))
return pulumi.String(base64.StdEncoding.EncodeToString(hashedData[:]))
} else {
panic(err.Error())
}
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
filePath := "/path/to/plugin.zip"
_, err := ec.NewDeploymentExtension(ctx, "exampleExtension", &ec.DeploymentExtensionArgs{
Description: pulumi.String("my extension"),
Version: pulumi.String("*"),
ExtensionType: pulumi.String("bundle"),
FilePath: pulumi.String(filePath),
FileHash: filebase64sha256OrPanic(filePath),
})
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.DeploymentExtension;
import com.pulumi.ec.DeploymentExtensionArgs;
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 filePath = "/path/to/plugin.zip";
var exampleExtension = new DeploymentExtension("exampleExtension", DeploymentExtensionArgs.builder()
.description("my extension")
.version("*")
.extensionType("bundle")
.filePath(filePath)
.fileHash(computeFileBase64Sha256(filePath))
.build());
}
}
import pulumi
import base64
import hashlib
import pulumi_ec as ec
def computeFilebase64sha256(path):
fileData = open(path).read().encode()
hashedData = hashlib.sha256(fileData.encode()).digest()
return base64.b64encode(hashedData).decode()
file_path = "/path/to/plugin.zip"
example_extension = ec.DeploymentExtension("exampleExtension",
description="my extension",
version="*",
extension_type="bundle",
file_path=file_path,
file_hash=computeFilebase64sha256(file_path))
import * as pulumi from "@pulumi/pulumi";
import * as crypto from "crypto";
import * as ec from "@pulumi/ec";
import * as fs from "fs";
func computeFilebase64sha256(path string) string {
const fileData = Buffer.from(fs.readFileSync(path), 'binary')
return crypto.createHash('sha256').update(fileData).digest('hex')
}
const filePath = "/path/to/plugin.zip";
const exampleExtension = new ec.DeploymentExtension("exampleExtension", {
description: "my extension",
version: "*",
extensionType: "bundle",
filePath: filePath,
fileHash: computeFilebase64sha256(filePath),
});
Coming soon!
With download URL
using System.Collections.Generic;
using Pulumi;
using ElasticCloud = Pulumi.ElasticCloud;
return await Deployment.RunAsync(() =>
{
var exampleExtension = new ElasticCloud.DeploymentExtension("exampleExtension", new()
{
Description = "my extension",
DownloadUrl = "https://example.net",
ExtensionType = "bundle",
Version = "*",
});
});
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 {
_, err := ec.NewDeploymentExtension(ctx, "exampleExtension", &ec.DeploymentExtensionArgs{
Description: pulumi.String("my extension"),
DownloadUrl: pulumi.String("https://example.net"),
ExtensionType: pulumi.String("bundle"),
Version: pulumi.String("*"),
})
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.DeploymentExtension;
import com.pulumi.ec.DeploymentExtensionArgs;
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 exampleExtension = new DeploymentExtension("exampleExtension", DeploymentExtensionArgs.builder()
.description("my extension")
.downloadUrl("https://example.net")
.extensionType("bundle")
.version("*")
.build());
}
}
import pulumi
import pulumi_ec as ec
example_extension = ec.DeploymentExtension("exampleExtension",
description="my extension",
download_url="https://example.net",
extension_type="bundle",
version="*")
import * as pulumi from "@pulumi/pulumi";
import * as ec from "@pulumi/ec";
const exampleExtension = new ec.DeploymentExtension("exampleExtension", {
description: "my extension",
downloadUrl: "https://example.net",
extensionType: "bundle",
version: "*",
});
resources:
exampleExtension:
type: ec:DeploymentExtension
properties:
description: my extension
downloadUrl: https://example.net
extensionType: bundle
version: '*'
Using extension in ec.Deployment
using System.Collections.Generic;
using Pulumi;
using ElasticCloud = Pulumi.ElasticCloud;
return await Deployment.RunAsync(() =>
{
var exampleExtension = new ElasticCloud.DeploymentExtension("exampleExtension", new()
{
Description = "my extension",
Version = "*",
ExtensionType = "bundle",
DownloadUrl = "https://example.net",
});
var latest = ElasticCloud.GetStack.Invoke(new()
{
VersionRegex = "latest",
Region = "us-east-1",
});
var withExtension = new ElasticCloud.Deployment("withExtension", new()
{
Region = "us-east-1",
Version = latest.Apply(getStackResult => getStackResult.Version),
DeploymentTemplateId = "aws-io-optimized-v2",
Elasticsearch = new ElasticCloud.Inputs.DeploymentElasticsearchArgs
{
Extensions = new[]
{
new ElasticCloud.Inputs.DeploymentElasticsearchExtensionArgs
{
Name = exampleExtension.Name,
Type = "bundle",
Version = latest.Apply(getStackResult => getStackResult.Version),
Url = exampleExtension.Url,
},
},
},
});
});
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 {
exampleExtension, err := ec.NewDeploymentExtension(ctx, "exampleExtension", &ec.DeploymentExtensionArgs{
Description: pulumi.String("my extension"),
Version: pulumi.String("*"),
ExtensionType: pulumi.String("bundle"),
DownloadUrl: pulumi.String("https://example.net"),
})
if err != nil {
return err
}
latest, err := ec.GetStack(ctx, &ec.GetStackArgs{
VersionRegex: "latest",
Region: "us-east-1",
}, nil)
if err != nil {
return err
}
_, err = ec.NewDeployment(ctx, "withExtension", &ec.DeploymentArgs{
Region: pulumi.String("us-east-1"),
Version: *pulumi.String(latest.Version),
DeploymentTemplateId: pulumi.String("aws-io-optimized-v2"),
Elasticsearch: &ec.DeploymentElasticsearchArgs{
Extensions: ec.DeploymentElasticsearchExtensionArray{
&ec.DeploymentElasticsearchExtensionArgs{
Name: exampleExtension.Name,
Type: pulumi.String("bundle"),
Version: *pulumi.String(latest.Version),
Url: exampleExtension.Url,
},
},
},
})
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.DeploymentExtension;
import com.pulumi.ec.DeploymentExtensionArgs;
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 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 exampleExtension = new DeploymentExtension("exampleExtension", DeploymentExtensionArgs.builder()
.description("my extension")
.version("*")
.extensionType("bundle")
.downloadUrl("https://example.net")
.build());
final var latest = EcFunctions.getStack(GetStackArgs.builder()
.versionRegex("latest")
.region("us-east-1")
.build());
var withExtension = new Deployment("withExtension", DeploymentArgs.builder()
.region("us-east-1")
.version(latest.applyValue(getStackResult -> getStackResult.version()))
.deploymentTemplateId("aws-io-optimized-v2")
.elasticsearch(DeploymentElasticsearchArgs.builder()
.extensions(DeploymentElasticsearchExtensionArgs.builder()
.name(exampleExtension.name())
.type("bundle")
.version(latest.applyValue(getStackResult -> getStackResult.version()))
.url(exampleExtension.url())
.build())
.build())
.build());
}
}
import pulumi
import pulumi_ec as ec
example_extension = ec.DeploymentExtension("exampleExtension",
description="my extension",
version="*",
extension_type="bundle",
download_url="https://example.net")
latest = ec.get_stack(version_regex="latest",
region="us-east-1")
with_extension = ec.Deployment("withExtension",
region="us-east-1",
version=latest.version,
deployment_template_id="aws-io-optimized-v2",
elasticsearch=ec.DeploymentElasticsearchArgs(
extensions=[ec.DeploymentElasticsearchExtensionArgs(
name=example_extension.name,
type="bundle",
version=latest.version,
url=example_extension.url,
)],
))
import * as pulumi from "@pulumi/pulumi";
import * as ec from "@pulumi/ec";
const exampleExtension = new ec.DeploymentExtension("exampleExtension", {
description: "my extension",
version: "*",
extensionType: "bundle",
downloadUrl: "https://example.net",
});
const latest = ec.getStack({
versionRegex: "latest",
region: "us-east-1",
});
const withExtension = new ec.Deployment("withExtension", {
region: "us-east-1",
version: latest.then(latest => latest.version),
deploymentTemplateId: "aws-io-optimized-v2",
elasticsearch: {
extensions: [{
name: exampleExtension.name,
type: "bundle",
version: latest.then(latest => latest.version),
url: exampleExtension.url,
}],
},
});
resources:
exampleExtension:
type: ec:DeploymentExtension
properties:
description: my extension
version: '*'
extensionType: bundle
downloadUrl: https://example.net
withExtension:
type: ec:Deployment
properties:
# Mandatory fields
region: us-east-1
version: ${latest.version}
deploymentTemplateId: aws-io-optimized-v2
elasticsearch:
extensions:
- name: ${exampleExtension.name}
type: bundle
version: ${latest.version}
url: ${exampleExtension.url}
variables:
latest:
fn::invoke:
Function: ec:getStack
Arguments:
versionRegex: latest
region: us-east-1
Create DeploymentExtension Resource
new DeploymentExtension(name: string, args: DeploymentExtensionArgs, opts?: CustomResourceOptions);
@overload
def DeploymentExtension(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
download_url: Optional[str] = None,
extension_type: Optional[str] = None,
file_hash: Optional[str] = None,
file_path: Optional[str] = None,
name: Optional[str] = None,
version: Optional[str] = None)
@overload
def DeploymentExtension(resource_name: str,
args: DeploymentExtensionArgs,
opts: Optional[ResourceOptions] = None)
func NewDeploymentExtension(ctx *Context, name string, args DeploymentExtensionArgs, opts ...ResourceOption) (*DeploymentExtension, error)
public DeploymentExtension(string name, DeploymentExtensionArgs args, CustomResourceOptions? opts = null)
public DeploymentExtension(String name, DeploymentExtensionArgs args)
public DeploymentExtension(String name, DeploymentExtensionArgs args, CustomResourceOptions options)
type: ec:DeploymentExtension
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeploymentExtensionArgs
- 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 DeploymentExtensionArgs
- 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 DeploymentExtensionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DeploymentExtensionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DeploymentExtensionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
DeploymentExtension 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 DeploymentExtension resource accepts the following input properties:
- Extension
Type string bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- Version string
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- Description string
Description of the extension.
- Download
Url string The URL to download the extension archive.
- File
Hash string Hash value of the file. If it is changed, the file is reuploaded.
- File
Path string File path of the extension uploaded.
- Name string
Name of the extension.
- Extension
Type string bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- Version string
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- Description string
Description of the extension.
- Download
Url string The URL to download the extension archive.
- File
Hash string Hash value of the file. If it is changed, the file is reuploaded.
- File
Path string File path of the extension uploaded.
- Name string
Name of the extension.
- extension
Type String bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- version String
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- description String
Description of the extension.
- download
Url String The URL to download the extension archive.
- file
Hash String Hash value of the file. If it is changed, the file is reuploaded.
- file
Path String File path of the extension uploaded.
- name String
Name of the extension.
- extension
Type string bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- version string
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- description string
Description of the extension.
- download
Url string The URL to download the extension archive.
- file
Hash string Hash value of the file. If it is changed, the file is reuploaded.
- file
Path string File path of the extension uploaded.
- name string
Name of the extension.
- extension_
type str bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- version str
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- description str
Description of the extension.
- download_
url str The URL to download the extension archive.
- file_
hash str Hash value of the file. If it is changed, the file is reuploaded.
- file_
path str File path of the extension uploaded.
- name str
Name of the extension.
- extension
Type String bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- version String
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- description String
Description of the extension.
- download
Url String The URL to download the extension archive.
- file
Hash String Hash value of the file. If it is changed, the file is reuploaded.
- file
Path String File path of the extension uploaded.
- name String
Name of the extension.
Outputs
All input properties are implicitly available as output properties. Additionally, the DeploymentExtension resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Last
Modified string The datetime the extension was last modified.
- Size int
The extension file size in bytes.
- Url string
The extension URL to be used in the plan.
- Id string
The provider-assigned unique ID for this managed resource.
- Last
Modified string The datetime the extension was last modified.
- Size int
The extension file size in bytes.
- Url string
The extension URL to be used in the plan.
- id String
The provider-assigned unique ID for this managed resource.
- last
Modified String The datetime the extension was last modified.
- size Integer
The extension file size in bytes.
- url String
The extension URL to be used in the plan.
- id string
The provider-assigned unique ID for this managed resource.
- last
Modified string The datetime the extension was last modified.
- size number
The extension file size in bytes.
- url string
The extension URL to be used in the plan.
- id str
The provider-assigned unique ID for this managed resource.
- last_
modified str The datetime the extension was last modified.
- size int
The extension file size in bytes.
- url str
The extension URL to be used in the plan.
- id String
The provider-assigned unique ID for this managed resource.
- last
Modified String The datetime the extension was last modified.
- size Number
The extension file size in bytes.
- url String
The extension URL to be used in the plan.
Look up Existing DeploymentExtension Resource
Get an existing DeploymentExtension 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?: DeploymentExtensionState, opts?: CustomResourceOptions): DeploymentExtension
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
download_url: Optional[str] = None,
extension_type: Optional[str] = None,
file_hash: Optional[str] = None,
file_path: Optional[str] = None,
last_modified: Optional[str] = None,
name: Optional[str] = None,
size: Optional[int] = None,
url: Optional[str] = None,
version: Optional[str] = None) -> DeploymentExtension
func GetDeploymentExtension(ctx *Context, name string, id IDInput, state *DeploymentExtensionState, opts ...ResourceOption) (*DeploymentExtension, error)
public static DeploymentExtension Get(string name, Input<string> id, DeploymentExtensionState? state, CustomResourceOptions? opts = null)
public static DeploymentExtension get(String name, Output<String> id, DeploymentExtensionState 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.
- Description string
Description of the extension.
- Download
Url string The URL to download the extension archive.
- Extension
Type string bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- File
Hash string Hash value of the file. If it is changed, the file is reuploaded.
- File
Path string File path of the extension uploaded.
- Last
Modified string The datetime the extension was last modified.
- Name string
Name of the extension.
- Size int
The extension file size in bytes.
- Url string
The extension URL to be used in the plan.
- Version string
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- Description string
Description of the extension.
- Download
Url string The URL to download the extension archive.
- Extension
Type string bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- File
Hash string Hash value of the file. If it is changed, the file is reuploaded.
- File
Path string File path of the extension uploaded.
- Last
Modified string The datetime the extension was last modified.
- Name string
Name of the extension.
- Size int
The extension file size in bytes.
- Url string
The extension URL to be used in the plan.
- Version string
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- description String
Description of the extension.
- download
Url String The URL to download the extension archive.
- extension
Type String bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- file
Hash String Hash value of the file. If it is changed, the file is reuploaded.
- file
Path String File path of the extension uploaded.
- last
Modified String The datetime the extension was last modified.
- name String
Name of the extension.
- size Integer
The extension file size in bytes.
- url String
The extension URL to be used in the plan.
- version String
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- description string
Description of the extension.
- download
Url string The URL to download the extension archive.
- extension
Type string bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- file
Hash string Hash value of the file. If it is changed, the file is reuploaded.
- file
Path string File path of the extension uploaded.
- last
Modified string The datetime the extension was last modified.
- name string
Name of the extension.
- size number
The extension file size in bytes.
- url string
The extension URL to be used in the plan.
- version string
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- description str
Description of the extension.
- download_
url str The URL to download the extension archive.
- extension_
type str bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- file_
hash str Hash value of the file. If it is changed, the file is reuploaded.
- file_
path str File path of the extension uploaded.
- last_
modified str The datetime the extension was last modified.
- name str
Name of the extension.
- size int
The extension file size in bytes.
- url str
The extension URL to be used in the plan.
- version str
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
- description String
Description of the extension.
- download
Url String The URL to download the extension archive.
- extension
Type String bundle
orplugin
allowed. Abundle
will usually contain a dictionary or script, where aplugin
is compiled from source.- file
Hash String Hash value of the file. If it is changed, the file is reuploaded.
- file
Path String File path of the extension uploaded.
- last
Modified String The datetime the extension was last modified.
- name String
Name of the extension.
- size Number
The extension file size in bytes.
- url String
The extension URL to be used in the plan.
- version String
Elastic stack version, a numeric version for plugins, e.g. 2.3.0 should be set. Major version e.g. 2.*, or wildcards e.g. * for bundles.
Package Details
- Repository
- ec pulumi/pulumi-ec
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
ec
Terraform Provider.