import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * > **WARNING:** Do not combine `aws.dynamodb.GlobalSecondaryIndex` resources in conjunction with `globalSecondaryIndex` on `aws.dynamodb.Table`. Doing so may cause conflicts, perpertual differences, and Global Secondary Indexes being overwritten. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const exampleTable = new aws.dynamodb.Table("example", { * attributes: [ * { * name: "UserId", * type: "S", * }, * { * name: "GameTitle", * type: "S", * }, * ], * name: "example", * billingMode: "PROVISIONED", * readCapacity: 20, * writeCapacity: 20, * hashKey: "UserId", * rangeKey: "GameTitle", * }); * const example = new aws.dynamodb.GlobalSecondaryIndex("example", { * projection: { * projectionType: "INCLUDE", * nonKeyAttributes: ["UserId"], * }, * provisionedThroughput: { * writeCapacityUnits: 10, * readCapacityUnits: 10, * }, * keySchemas: [{ * attributeName: "GameTitle", * attributeType: "S", * keyType: "HASH", * }], * tableName: exampleTable.name, * indexName: "GameTitleIndex", * }); * ``` * * ### Migrating * * Use the following steps to migrate existing Global Secondary Indexes defined inline in `globalSecondaryIndex` on an `aws.dynamodb.Table`. * * For each block `globalSecondaryIndex` create a new `aws.dynamodb.GlobalSecondaryIndex` resource with configuration corresponding to the existing block. * * For example, starting with the following configuration: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.dynamodb.Table("example", { * attributes: [ * { * name: "example-key", * type: "S", * }, * { * name: "example-gsi-key-1", * type: "S", * }, * { * name: "example-gsi-key-2", * type: "S", * }, * ], * globalSecondaryIndexes: [ * { * name: "example-index-1", * projectionType: "ALL", * hashKey: "example-gsi-key-1", * readCapacity: 1, * writeCapacity: 1, * }, * { * name: "example-index-2", * projectionType: "ALL", * hashKey: "example-gsi-key-2", * readCapacity: 1, * writeCapacity: 1, * }, * ], * name: "example-table", * hashKey: "example-key", * readCapacity: 1, * writeCapacity: 1, * }); * ``` * * Update the configuration to the following. Note that the schema of `aws.dynamodb.GlobalSecondaryIndex` has some differences with `globalSecondaryIndex` on `aws.dynamodb.Table`. * * If using Terraform versions prior to v1.5.0, remove the `import` blocks and use the `pulumi import` command. * * #### Optional * * * `accountId` (String) AWS Account where this resource is managed. * * `region` (String) Region where this resource is managed. * * Using `pulumi import`, import DynamoDB tables using the `tableName` and `indexName`, separated by a comma. For example: * * ```sh * $ pulumi import aws:dynamodb/globalSecondaryIndex:GlobalSecondaryIndex example 'example-table,example-index' * ``` */ export declare class GlobalSecondaryIndex extends pulumi.CustomResource { /** * Get an existing GlobalSecondaryIndex resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: GlobalSecondaryIndexState, opts?: pulumi.CustomResourceOptions): GlobalSecondaryIndex; /** * Returns true if the given object is an instance of GlobalSecondaryIndex. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is GlobalSecondaryIndex; /** * ARN of the GSI. */ readonly arn: pulumi.Output; /** * Name of the index. */ readonly indexName: pulumi.Output; /** * Set of nested attribute definitions. * At least 1 element defining a `HASH` is required. * All elements with the `keyType` of `HASH` must precede elements with `keyType` of `RANGE`. * Changing any values in `keySchema` will re-create the resource. * See `keySchema` below. */ readonly keySchemas: pulumi.Output; /** * Sets the maximum number of read and write units for the index. * See `onDemandThroughput` below. * Only valid if the table's `billingMode` is `PAY_PER_REQUEST`. */ readonly onDemandThroughput: pulumi.Output; /** * Describes which attributes from the table are represented in the index. * See `projection` below. */ readonly projection: pulumi.Output; /** * Provisioned throughput for the index. * See `provisionedThroughput` below. * Required if the table's `billingMode` is `PROVISIONED`. */ readonly provisionedThroughput: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; /** * Name of the table this index belongs to. * * The following arguments are optional: */ readonly tableName: pulumi.Output; readonly timeouts: pulumi.Output; /** * Sets the number of warm read and write units for this index. * See `warmThroughput` below. */ readonly warmThroughput: pulumi.Output; /** * Create a GlobalSecondaryIndex resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: GlobalSecondaryIndexArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering GlobalSecondaryIndex resources. */ export interface GlobalSecondaryIndexState { /** * ARN of the GSI. */ arn?: pulumi.Input; /** * Name of the index. */ indexName?: pulumi.Input; /** * Set of nested attribute definitions. * At least 1 element defining a `HASH` is required. * All elements with the `keyType` of `HASH` must precede elements with `keyType` of `RANGE`. * Changing any values in `keySchema` will re-create the resource. * See `keySchema` below. */ keySchemas?: pulumi.Input[] | undefined>; /** * Sets the maximum number of read and write units for the index. * See `onDemandThroughput` below. * Only valid if the table's `billingMode` is `PAY_PER_REQUEST`. */ onDemandThroughput?: pulumi.Input; /** * Describes which attributes from the table are represented in the index. * See `projection` below. */ projection?: pulumi.Input; /** * Provisioned throughput for the index. * See `provisionedThroughput` below. * Required if the table's `billingMode` is `PROVISIONED`. */ provisionedThroughput?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Name of the table this index belongs to. * * The following arguments are optional: */ tableName?: pulumi.Input; timeouts?: pulumi.Input; /** * Sets the number of warm read and write units for this index. * See `warmThroughput` below. */ warmThroughput?: pulumi.Input; } /** * The set of arguments for constructing a GlobalSecondaryIndex resource. */ export interface GlobalSecondaryIndexArgs { /** * Name of the index. */ indexName: pulumi.Input; /** * Set of nested attribute definitions. * At least 1 element defining a `HASH` is required. * All elements with the `keyType` of `HASH` must precede elements with `keyType` of `RANGE`. * Changing any values in `keySchema` will re-create the resource. * See `keySchema` below. */ keySchemas: pulumi.Input[]>; /** * Sets the maximum number of read and write units for the index. * See `onDemandThroughput` below. * Only valid if the table's `billingMode` is `PAY_PER_REQUEST`. */ onDemandThroughput?: pulumi.Input; /** * Describes which attributes from the table are represented in the index. * See `projection` below. */ projection?: pulumi.Input; /** * Provisioned throughput for the index. * See `provisionedThroughput` below. * Required if the table's `billingMode` is `PROVISIONED`. */ provisionedThroughput?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; /** * Name of the table this index belongs to. * * The following arguments are optional: */ tableName: pulumi.Input; timeouts?: pulumi.Input; /** * Sets the number of warm read and write units for this index. * See `warmThroughput` below. */ warmThroughput?: pulumi.Input; } //# sourceMappingURL=globalSecondaryIndex.d.ts.map