ServerlessCollectionArgs

data class ServerlessCollectionArgs(val description: Output<String>? = null, val name: Output<String>? = null, val standbyReplicas: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val timeouts: Output<ServerlessCollectionTimeoutsArgs>? = null, val type: Output<String>? = null) : ConvertibleToJava<ServerlessCollectionArgs>

Resource for managing an AWS OpenSearch Serverless Collection.

NOTE: An aws.opensearch.ServerlessCollection cannot be created without having an applicable encryption security policy. Use the depends_on meta-argument to define this dependency. NOTE: An aws.opensearch.ServerlessCollection is not accessible without configuring an applicable network security policy. Data cannot be accessed without configuring an applicable data access policy.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.opensearch.ServerlessSecurityPolicy("example", {
name: "example",
type: "encryption",
policy: JSON.stringify({
Rules: [{
Resource: ["collection/example"],
ResourceType: "collection",
}],
AWSOwnedKey: true,
}),
});
const exampleServerlessCollection = new aws.opensearch.ServerlessCollection("example", {name: "example"}, {
dependsOn: [example],
});
import pulumi
import json
import pulumi_aws as aws
example = aws.opensearch.ServerlessSecurityPolicy("example",
name="example",
type="encryption",
policy=json.dumps({
"Rules": [{
"Resource": ["collection/example"],
"ResourceType": "collection",
}],
"AWSOwnedKey": True,
}))
example_serverless_collection = aws.opensearch.ServerlessCollection("example", name="example",
opts = pulumi.ResourceOptions(depends_on=[example]))
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.OpenSearch.ServerlessSecurityPolicy("example", new()
{
Name = "example",
Type = "encryption",
Policy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Rules"] = new[]
{
new Dictionary<string, object?>
{
["Resource"] = new[]
{
"collection/example",
},
["ResourceType"] = "collection",
},
},
["AWSOwnedKey"] = true,
}),
});
var exampleServerlessCollection = new Aws.OpenSearch.ServerlessCollection("example", new()
{
Name = "example",
}, new CustomResourceOptions
{
DependsOn =
{
example,
},
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"Rules": []map[string]interface{}{
map[string]interface{}{
"Resource": []string{
"collection/example",
},
"ResourceType": "collection",
},
},
"AWSOwnedKey": true,
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
example, err := opensearch.NewServerlessSecurityPolicy(ctx, "example", &opensearch.ServerlessSecurityPolicyArgs{
Name: pulumi.String("example"),
Type: pulumi.String("encryption"),
Policy: pulumi.String(json0),
})
if err != nil {
return err
}
_, err = opensearch.NewServerlessCollection(ctx, "example", &opensearch.ServerlessCollectionArgs{
Name: pulumi.String("example"),
}, pulumi.DependsOn([]pulumi.Resource{
example,
}))
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.aws.opensearch.ServerlessSecurityPolicy;
import com.pulumi.aws.opensearch.ServerlessSecurityPolicyArgs;
import com.pulumi.aws.opensearch.ServerlessCollection;
import com.pulumi.aws.opensearch.ServerlessCollectionArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import com.pulumi.resources.CustomResourceOptions;
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 ServerlessSecurityPolicy("example", ServerlessSecurityPolicyArgs.builder()
.name("example")
.type("encryption")
.policy(serializeJson(
jsonObject(
jsonProperty("Rules", jsonArray(jsonObject(
jsonProperty("Resource", jsonArray("collection/example")),
jsonProperty("ResourceType", "collection")
))),
jsonProperty("AWSOwnedKey", true)
)))
.build());
var exampleServerlessCollection = new ServerlessCollection("exampleServerlessCollection", ServerlessCollectionArgs.builder()
.name("example")
.build(), CustomResourceOptions.builder()
.dependsOn(example)
.build());
}
}
resources:
example:
type: aws:opensearch:ServerlessSecurityPolicy
properties:
name: example
type: encryption
policy:
fn::toJSON:
Rules:
- Resource:
- collection/example
ResourceType: collection
AWSOwnedKey: true
exampleServerlessCollection:
type: aws:opensearch:ServerlessCollection
name: example
properties:
name: example
options:
dependsOn:
- ${example}

Import

Using pulumi import, import OpenSearchServerless Collection using the id. For example:

$ pulumi import aws:opensearch/serverlessCollection:ServerlessCollection example example

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, name: Output<String>? = null, standbyReplicas: Output<String>? = null, tags: Output<Map<String, String>>? = null, timeouts: Output<ServerlessCollectionTimeoutsArgs>? = null, type: Output<String>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

Description of the collection.

Link copied to clipboard
val name: Output<String>? = null

Name of the collection. The following arguments are optional:

Link copied to clipboard
val standbyReplicas: Output<String>? = null

Indicates whether standby replicas should be used for a collection. One of ENABLED or DISABLED. Defaults to ENABLED.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the collection. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
Link copied to clipboard
val type: Output<String>? = null

Type of collection. One of SEARCH, TIMESERIES, or VECTORSEARCH. Defaults to TIMESERIES.

Functions

Link copied to clipboard
open override fun toJava(): ServerlessCollectionArgs