1. Packages
  2. AWS Classic
  3. API Docs
  4. opensearch
  5. Package

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.opensearch.Package

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Manages an AWS Opensearch Package.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as std from "@pulumi/std";
    
    const myOpensearchPackages = new aws.s3.BucketV2("my_opensearch_packages", {bucket: "my-opensearch-packages"});
    const example = new aws.s3.BucketObjectv2("example", {
        bucket: myOpensearchPackages.bucket,
        key: "example.txt",
        source: new pulumi.asset.FileAsset("./example.txt"),
        etag: std.filemd5({
            input: "./example.txt",
        }).then(invoke => invoke.result),
    });
    const examplePackage = new aws.opensearch.Package("example", {
        packageName: "example-txt",
        packageSource: {
            s3BucketName: myOpensearchPackages.bucket,
            s3Key: example.key,
        },
        packageType: "TXT-DICTIONARY",
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_std as std
    
    my_opensearch_packages = aws.s3.BucketV2("my_opensearch_packages", bucket="my-opensearch-packages")
    example = aws.s3.BucketObjectv2("example",
        bucket=my_opensearch_packages.bucket,
        key="example.txt",
        source=pulumi.FileAsset("./example.txt"),
        etag=std.filemd5(input="./example.txt").result)
    example_package = aws.opensearch.Package("example",
        package_name="example-txt",
        package_source={
            "s3BucketName": my_opensearch_packages.bucket,
            "s3Key": example.key,
        },
        package_type="TXT-DICTIONARY")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    	"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 {
    		myOpensearchPackages, err := s3.NewBucketV2(ctx, "my_opensearch_packages", &s3.BucketV2Args{
    			Bucket: pulumi.String("my-opensearch-packages"),
    		})
    		if err != nil {
    			return err
    		}
    		invokeFilemd5, err := std.Filemd5(ctx, &std.Filemd5Args{
    			Input: "./example.txt",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		example, err := s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{
    			Bucket: myOpensearchPackages.Bucket,
    			Key:    pulumi.String("example.txt"),
    			Source: pulumi.NewFileAsset("./example.txt"),
    			Etag:   invokeFilemd5.Result,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = opensearch.NewPackage(ctx, "example", &opensearch.PackageArgs{
    			PackageName: pulumi.String("example-txt"),
    			PackageSource: &opensearch.PackagePackageSourceArgs{
    				S3BucketName: myOpensearchPackages.Bucket,
    				S3Key:        example.Key,
    			},
    			PackageType: pulumi.String("TXT-DICTIONARY"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var myOpensearchPackages = new Aws.S3.BucketV2("my_opensearch_packages", new()
        {
            Bucket = "my-opensearch-packages",
        });
    
        var example = new Aws.S3.BucketObjectv2("example", new()
        {
            Bucket = myOpensearchPackages.Bucket,
            Key = "example.txt",
            Source = new FileAsset("./example.txt"),
            Etag = Std.Filemd5.Invoke(new()
            {
                Input = "./example.txt",
            }).Apply(invoke => invoke.Result),
        });
    
        var examplePackage = new Aws.OpenSearch.Package("example", new()
        {
            PackageName = "example-txt",
            PackageSource = new Aws.OpenSearch.Inputs.PackagePackageSourceArgs
            {
                S3BucketName = myOpensearchPackages.Bucket,
                S3Key = example.Key,
            },
            PackageType = "TXT-DICTIONARY",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.s3.BucketV2;
    import com.pulumi.aws.s3.BucketV2Args;
    import com.pulumi.aws.s3.BucketObjectv2;
    import com.pulumi.aws.s3.BucketObjectv2Args;
    import com.pulumi.aws.opensearch.Package;
    import com.pulumi.aws.opensearch.PackageArgs;
    import com.pulumi.aws.opensearch.inputs.PackagePackageSourceArgs;
    import com.pulumi.asset.FileAsset;
    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 myOpensearchPackages = new BucketV2("myOpensearchPackages", BucketV2Args.builder()
                .bucket("my-opensearch-packages")
                .build());
    
            var example = new BucketObjectv2("example", BucketObjectv2Args.builder()
                .bucket(myOpensearchPackages.bucket())
                .key("example.txt")
                .source(new FileAsset("./example.txt"))
                .etag(StdFunctions.filemd5(Filemd5Args.builder()
                    .input("./example.txt")
                    .build()).result())
                .build());
    
            var examplePackage = new Package("examplePackage", PackageArgs.builder()
                .packageName("example-txt")
                .packageSource(PackagePackageSourceArgs.builder()
                    .s3BucketName(myOpensearchPackages.bucket())
                    .s3Key(example.key())
                    .build())
                .packageType("TXT-DICTIONARY")
                .build());
    
        }
    }
    
    resources:
      myOpensearchPackages:
        type: aws:s3:BucketV2
        name: my_opensearch_packages
        properties:
          bucket: my-opensearch-packages
      example:
        type: aws:s3:BucketObjectv2
        properties:
          bucket: ${myOpensearchPackages.bucket}
          key: example.txt
          source:
            fn::FileAsset: ./example.txt
          etag:
            fn::invoke:
              Function: std:filemd5
              Arguments:
                input: ./example.txt
              Return: result
      examplePackage:
        type: aws:opensearch:Package
        name: example
        properties:
          packageName: example-txt
          packageSource:
            s3BucketName: ${myOpensearchPackages.bucket}
            s3Key: ${example.key}
          packageType: TXT-DICTIONARY
    

    Create Package Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Package(name: string, args: PackageArgs, opts?: CustomResourceOptions);
    @overload
    def Package(resource_name: str,
                args: PackageArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Package(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                package_name: Optional[str] = None,
                package_source: Optional[PackagePackageSourceArgs] = None,
                package_type: Optional[str] = None,
                package_description: Optional[str] = None)
    func NewPackage(ctx *Context, name string, args PackageArgs, opts ...ResourceOption) (*Package, error)
    public Package(string name, PackageArgs args, CustomResourceOptions? opts = null)
    public Package(String name, PackageArgs args)
    public Package(String name, PackageArgs args, CustomResourceOptions options)
    
    type: aws:opensearch:Package
    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 PackageArgs
    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 PackageArgs
    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 PackageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PackageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PackageArgs
    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 packageResource = new Aws.OpenSearch.Package("packageResource", new()
    {
        PackageName = "string",
        PackageSource = new Aws.OpenSearch.Inputs.PackagePackageSourceArgs
        {
            S3BucketName = "string",
            S3Key = "string",
        },
        PackageType = "string",
        PackageDescription = "string",
    });
    
    example, err := opensearch.NewPackage(ctx, "packageResource", &opensearch.PackageArgs{
    	PackageName: pulumi.String("string"),
    	PackageSource: &opensearch.PackagePackageSourceArgs{
    		S3BucketName: pulumi.String("string"),
    		S3Key:        pulumi.String("string"),
    	},
    	PackageType:        pulumi.String("string"),
    	PackageDescription: pulumi.String("string"),
    })
    
    var packageResource = new Package("packageResource", PackageArgs.builder()
        .packageName("string")
        .packageSource(PackagePackageSourceArgs.builder()
            .s3BucketName("string")
            .s3Key("string")
            .build())
        .packageType("string")
        .packageDescription("string")
        .build());
    
    package_resource = aws.opensearch.Package("packageResource",
        package_name="string",
        package_source={
            "s3BucketName": "string",
            "s3Key": "string",
        },
        package_type="string",
        package_description="string")
    
    const packageResource = new aws.opensearch.Package("packageResource", {
        packageName: "string",
        packageSource: {
            s3BucketName: "string",
            s3Key: "string",
        },
        packageType: "string",
        packageDescription: "string",
    });
    
    type: aws:opensearch:Package
    properties:
        packageDescription: string
        packageName: string
        packageSource:
            s3BucketName: string
            s3Key: string
        packageType: string
    

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

    PackageName string
    Unique name for the package.
    PackageSource PackagePackageSource
    Configuration block for the package source options.
    PackageType string
    The type of package.
    PackageDescription string
    Description of the package.
    PackageName string
    Unique name for the package.
    PackageSource PackagePackageSourceArgs
    Configuration block for the package source options.
    PackageType string
    The type of package.
    PackageDescription string
    Description of the package.
    packageName String
    Unique name for the package.
    packageSource PackagePackageSource
    Configuration block for the package source options.
    packageType String
    The type of package.
    packageDescription String
    Description of the package.
    packageName string
    Unique name for the package.
    packageSource PackagePackageSource
    Configuration block for the package source options.
    packageType string
    The type of package.
    packageDescription string
    Description of the package.
    package_name str
    Unique name for the package.
    package_source PackagePackageSourceArgs
    Configuration block for the package source options.
    package_type str
    The type of package.
    package_description str
    Description of the package.
    packageName String
    Unique name for the package.
    packageSource Property Map
    Configuration block for the package source options.
    packageType String
    The type of package.
    packageDescription String
    Description of the package.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Package resource produces the following output properties:

    AvailablePackageVersion string
    The current version of the package.
    Id string
    The provider-assigned unique ID for this managed resource.
    PackageId string
    AvailablePackageVersion string
    The current version of the package.
    Id string
    The provider-assigned unique ID for this managed resource.
    PackageId string
    availablePackageVersion String
    The current version of the package.
    id String
    The provider-assigned unique ID for this managed resource.
    packageId String
    availablePackageVersion string
    The current version of the package.
    id string
    The provider-assigned unique ID for this managed resource.
    packageId string
    available_package_version str
    The current version of the package.
    id str
    The provider-assigned unique ID for this managed resource.
    package_id str
    availablePackageVersion String
    The current version of the package.
    id String
    The provider-assigned unique ID for this managed resource.
    packageId String

    Look up Existing Package Resource

    Get an existing Package 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?: PackageState, opts?: CustomResourceOptions): Package
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            available_package_version: Optional[str] = None,
            package_description: Optional[str] = None,
            package_id: Optional[str] = None,
            package_name: Optional[str] = None,
            package_source: Optional[PackagePackageSourceArgs] = None,
            package_type: Optional[str] = None) -> Package
    func GetPackage(ctx *Context, name string, id IDInput, state *PackageState, opts ...ResourceOption) (*Package, error)
    public static Package Get(string name, Input<string> id, PackageState? state, CustomResourceOptions? opts = null)
    public static Package get(String name, Output<String> id, PackageState 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:
    AvailablePackageVersion string
    The current version of the package.
    PackageDescription string
    Description of the package.
    PackageId string
    PackageName string
    Unique name for the package.
    PackageSource PackagePackageSource
    Configuration block for the package source options.
    PackageType string
    The type of package.
    AvailablePackageVersion string
    The current version of the package.
    PackageDescription string
    Description of the package.
    PackageId string
    PackageName string
    Unique name for the package.
    PackageSource PackagePackageSourceArgs
    Configuration block for the package source options.
    PackageType string
    The type of package.
    availablePackageVersion String
    The current version of the package.
    packageDescription String
    Description of the package.
    packageId String
    packageName String
    Unique name for the package.
    packageSource PackagePackageSource
    Configuration block for the package source options.
    packageType String
    The type of package.
    availablePackageVersion string
    The current version of the package.
    packageDescription string
    Description of the package.
    packageId string
    packageName string
    Unique name for the package.
    packageSource PackagePackageSource
    Configuration block for the package source options.
    packageType string
    The type of package.
    available_package_version str
    The current version of the package.
    package_description str
    Description of the package.
    package_id str
    package_name str
    Unique name for the package.
    package_source PackagePackageSourceArgs
    Configuration block for the package source options.
    package_type str
    The type of package.
    availablePackageVersion String
    The current version of the package.
    packageDescription String
    Description of the package.
    packageId String
    packageName String
    Unique name for the package.
    packageSource Property Map
    Configuration block for the package source options.
    packageType String
    The type of package.

    Supporting Types

    PackagePackageSource, PackagePackageSourceArgs

    S3BucketName string
    The name of the Amazon S3 bucket containing the package.
    S3Key string
    Key (file name) of the package.
    S3BucketName string
    The name of the Amazon S3 bucket containing the package.
    S3Key string
    Key (file name) of the package.
    s3BucketName String
    The name of the Amazon S3 bucket containing the package.
    s3Key String
    Key (file name) of the package.
    s3BucketName string
    The name of the Amazon S3 bucket containing the package.
    s3Key string
    Key (file name) of the package.
    s3_bucket_name str
    The name of the Amazon S3 bucket containing the package.
    s3_key str
    Key (file name) of the package.
    s3BucketName String
    The name of the Amazon S3 bucket containing the package.
    s3Key String
    Key (file name) of the package.

    Import

    Using pulumi import, import AWS Opensearch Packages using the Package ID. For example:

    $ pulumi import aws:opensearch/package:Package example package-id
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi