opensearch.IsmPolicyMapping
Explore with Pulumi AI
Provides an OpenSearch Index State Management (ISM) policy. Please refer to the OpenSearch ISM documentation for details.
!> opensearch.IsmPolicyMapping
is deprecated in OpenSearch 1.x please use the opensearch.IsmPolicy
resource and specify the ism_template
attribute in the policies instead.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as opensearch from "@pulumi/opensearch";
const test = new opensearch.IsmPolicyMapping("test", {
indexes: "test_index",
policyId: "policy_1",
state: "delete",
});
import pulumi
import pulumi_opensearch as opensearch
test = opensearch.IsmPolicyMapping("test",
indexes="test_index",
policy_id="policy_1",
state="delete")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opensearch/v2/opensearch"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opensearch.NewIsmPolicyMapping(ctx, "test", &opensearch.IsmPolicyMappingArgs{
Indexes: pulumi.String("test_index"),
PolicyId: pulumi.String("policy_1"),
State: pulumi.String("delete"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opensearch = Pulumi.Opensearch;
return await Deployment.RunAsync(() =>
{
var test = new Opensearch.IsmPolicyMapping("test", new()
{
Indexes = "test_index",
PolicyId = "policy_1",
State = "delete",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opensearch.IsmPolicyMapping;
import com.pulumi.opensearch.IsmPolicyMappingArgs;
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 test = new IsmPolicyMapping("test", IsmPolicyMappingArgs.builder()
.indexes("test_index")
.policyId("policy_1")
.state("delete")
.build());
}
}
resources:
test:
type: opensearch:IsmPolicyMapping
properties:
indexes: test_index
policyId: policy_1
state: delete
Create IsmPolicyMapping Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IsmPolicyMapping(name: string, args: IsmPolicyMappingArgs, opts?: CustomResourceOptions);
@overload
def IsmPolicyMapping(resource_name: str,
args: IsmPolicyMappingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IsmPolicyMapping(resource_name: str,
opts: Optional[ResourceOptions] = None,
indexes: Optional[str] = None,
policy_id: Optional[str] = None,
includes: Optional[Sequence[Mapping[str, str]]] = None,
is_safe: Optional[bool] = None,
ism_policy_mapping_id: Optional[str] = None,
managed_indexes: Optional[Sequence[str]] = None,
state: Optional[str] = None,
timeouts: Optional[IsmPolicyMappingTimeoutsArgs] = None)
func NewIsmPolicyMapping(ctx *Context, name string, args IsmPolicyMappingArgs, opts ...ResourceOption) (*IsmPolicyMapping, error)
public IsmPolicyMapping(string name, IsmPolicyMappingArgs args, CustomResourceOptions? opts = null)
public IsmPolicyMapping(String name, IsmPolicyMappingArgs args)
public IsmPolicyMapping(String name, IsmPolicyMappingArgs args, CustomResourceOptions options)
type: opensearch:IsmPolicyMapping
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 IsmPolicyMappingArgs
- 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 IsmPolicyMappingArgs
- 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 IsmPolicyMappingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IsmPolicyMappingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IsmPolicyMappingArgs
- 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 ismPolicyMappingResource = new Opensearch.IsmPolicyMapping("ismPolicyMappingResource", new()
{
Indexes = "string",
PolicyId = "string",
Includes = new[]
{
{
{ "string", "string" },
},
},
IsSafe = false,
IsmPolicyMappingId = "string",
ManagedIndexes = new[]
{
"string",
},
State = "string",
Timeouts = new Opensearch.Inputs.IsmPolicyMappingTimeoutsArgs
{
Create = "string",
Update = "string",
},
});
example, err := opensearch.NewIsmPolicyMapping(ctx, "ismPolicyMappingResource", &opensearch.IsmPolicyMappingArgs{
Indexes: pulumi.String("string"),
PolicyId: pulumi.String("string"),
Includes: pulumi.StringMapArray{
pulumi.StringMap{
"string": pulumi.String("string"),
},
},
IsSafe: pulumi.Bool(false),
IsmPolicyMappingId: pulumi.String("string"),
ManagedIndexes: pulumi.StringArray{
pulumi.String("string"),
},
State: pulumi.String("string"),
Timeouts: &opensearch.IsmPolicyMappingTimeoutsArgs{
Create: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var ismPolicyMappingResource = new IsmPolicyMapping("ismPolicyMappingResource", IsmPolicyMappingArgs.builder()
.indexes("string")
.policyId("string")
.includes(Map.of("string", "string"))
.isSafe(false)
.ismPolicyMappingId("string")
.managedIndexes("string")
.state("string")
.timeouts(IsmPolicyMappingTimeoutsArgs.builder()
.create("string")
.update("string")
.build())
.build());
ism_policy_mapping_resource = opensearch.IsmPolicyMapping("ismPolicyMappingResource",
indexes="string",
policy_id="string",
includes=[{
"string": "string",
}],
is_safe=False,
ism_policy_mapping_id="string",
managed_indexes=["string"],
state="string",
timeouts={
"create": "string",
"update": "string",
})
const ismPolicyMappingResource = new opensearch.IsmPolicyMapping("ismPolicyMappingResource", {
indexes: "string",
policyId: "string",
includes: [{
string: "string",
}],
isSafe: false,
ismPolicyMappingId: "string",
managedIndexes: ["string"],
state: "string",
timeouts: {
create: "string",
update: "string",
},
});
type: opensearch:IsmPolicyMapping
properties:
includes:
- string: string
indexes: string
isSafe: false
ismPolicyMappingId: string
managedIndexes:
- string
policyId: string
state: string
timeouts:
create: string
update: string
IsmPolicyMapping Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IsmPolicyMapping resource accepts the following input properties:
- Indexes string
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- Policy
Id string - The name of the policy.
- Includes
List<Immutable
Dictionary<string, string>> - When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- Is
Safe bool - Ism
Policy stringMapping Id - The ID of this resource.
- Managed
Indexes List<string> - State string
- After a change in policy takes place, specify the state for the index to transition to
- Timeouts
Ism
Policy Mapping Timeouts
- Indexes string
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- Policy
Id string - The name of the policy.
- Includes []map[string]string
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- Is
Safe bool - Ism
Policy stringMapping Id - The ID of this resource.
- Managed
Indexes []string - State string
- After a change in policy takes place, specify the state for the index to transition to
- Timeouts
Ism
Policy Mapping Timeouts Args
- indexes String
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- policy
Id String - The name of the policy.
- includes List<Map<String,String>>
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- is
Safe Boolean - ism
Policy StringMapping Id - The ID of this resource.
- managed
Indexes List<String> - state String
- After a change in policy takes place, specify the state for the index to transition to
- timeouts
Ism
Policy Mapping Timeouts
- indexes string
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- policy
Id string - The name of the policy.
- includes {[key: string]: string}[]
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- is
Safe boolean - ism
Policy stringMapping Id - The ID of this resource.
- managed
Indexes string[] - state string
- After a change in policy takes place, specify the state for the index to transition to
- timeouts
Ism
Policy Mapping Timeouts
- indexes str
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- policy_
id str - The name of the policy.
- includes Sequence[Mapping[str, str]]
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- is_
safe bool - ism_
policy_ strmapping_ id - The ID of this resource.
- managed_
indexes Sequence[str] - state str
- After a change in policy takes place, specify the state for the index to transition to
- timeouts
Ism
Policy Mapping Timeouts Args
- indexes String
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- policy
Id String - The name of the policy.
- includes List<Map<String>>
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- is
Safe Boolean - ism
Policy StringMapping Id - The ID of this resource.
- managed
Indexes List<String> - state String
- After a change in policy takes place, specify the state for the index to transition to
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the IsmPolicyMapping 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 IsmPolicyMapping Resource
Get an existing IsmPolicyMapping 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?: IsmPolicyMappingState, opts?: CustomResourceOptions): IsmPolicyMapping
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
includes: Optional[Sequence[Mapping[str, str]]] = None,
indexes: Optional[str] = None,
is_safe: Optional[bool] = None,
ism_policy_mapping_id: Optional[str] = None,
managed_indexes: Optional[Sequence[str]] = None,
policy_id: Optional[str] = None,
state: Optional[str] = None,
timeouts: Optional[IsmPolicyMappingTimeoutsArgs] = None) -> IsmPolicyMapping
func GetIsmPolicyMapping(ctx *Context, name string, id IDInput, state *IsmPolicyMappingState, opts ...ResourceOption) (*IsmPolicyMapping, error)
public static IsmPolicyMapping Get(string name, Input<string> id, IsmPolicyMappingState? state, CustomResourceOptions? opts = null)
public static IsmPolicyMapping get(String name, Output<String> id, IsmPolicyMappingState state, CustomResourceOptions options)
resources: _: type: opensearch:IsmPolicyMapping get: id: ${id}
- 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.
- Includes
List<Immutable
Dictionary<string, string>> - When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- Indexes string
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- Is
Safe bool - Ism
Policy stringMapping Id - The ID of this resource.
- Managed
Indexes List<string> - Policy
Id string - The name of the policy.
- State string
- After a change in policy takes place, specify the state for the index to transition to
- Timeouts
Ism
Policy Mapping Timeouts
- Includes []map[string]string
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- Indexes string
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- Is
Safe bool - Ism
Policy stringMapping Id - The ID of this resource.
- Managed
Indexes []string - Policy
Id string - The name of the policy.
- State string
- After a change in policy takes place, specify the state for the index to transition to
- Timeouts
Ism
Policy Mapping Timeouts Args
- includes List<Map<String,String>>
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- indexes String
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- is
Safe Boolean - ism
Policy StringMapping Id - The ID of this resource.
- managed
Indexes List<String> - policy
Id String - The name of the policy.
- state String
- After a change in policy takes place, specify the state for the index to transition to
- timeouts
Ism
Policy Mapping Timeouts
- includes {[key: string]: string}[]
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- indexes string
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- is
Safe boolean - ism
Policy stringMapping Id - The ID of this resource.
- managed
Indexes string[] - policy
Id string - The name of the policy.
- state string
- After a change in policy takes place, specify the state for the index to transition to
- timeouts
Ism
Policy Mapping Timeouts
- includes Sequence[Mapping[str, str]]
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- indexes str
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- is_
safe bool - ism_
policy_ strmapping_ id - The ID of this resource.
- managed_
indexes Sequence[str] - policy_
id str - The name of the policy.
- state str
- After a change in policy takes place, specify the state for the index to transition to
- timeouts
Ism
Policy Mapping Timeouts Args
- includes List<Map<String>>
- When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The background process only applies the change if the index is currently in the state specified.
- indexes String
- Name of the index to apply the policy to. You can use an index pattern to update multiple indices at once.
- is
Safe Boolean - ism
Policy StringMapping Id - The ID of this resource.
- managed
Indexes List<String> - policy
Id String - The name of the policy.
- state String
- After a change in policy takes place, specify the state for the index to transition to
- timeouts Property Map
Supporting Types
IsmPolicyMappingTimeouts, IsmPolicyMappingTimeoutsArgs
Import
Import by poilcy_id
$ pulumi import opensearch:index/ismPolicyMapping:IsmPolicyMapping test policy_1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- opensearch opensearch-project/terraform-provider-opensearch
- License
- Notes
- This Pulumi package is based on the
opensearch
Terraform Provider.