Package com.pulumi.aws.dynamodb
Class TableItem
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.dynamodb.TableItem
-
public class TableItem extends com.pulumi.resources.CustomResourceProvides a DynamoDB table item resource > **Note:** This resource is not meant to be used for managing large amounts of data in your table, it is not designed to scale. You should perform **regular backups** of all data in the table, see [AWS docs for more](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/BackupRestore.html). ## Example Usage
## Import ### Identity Schema #### Required * `tableName` (String) Name of the DynamoDB table. * `hashKeyValue` (String) Canonical value of the hash key (base64 for `B`, verbatim for `N` and `S`). #### Optional * `rangeKeyValue` (String) Canonical value of the range key, required for tables that define a range key. * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. For tables with a range key, append the range key value: Use `pulumi import` for the same effect on the command line: ```sh $ pulumi import aws:dynamodb/tableItem:TableItem example example-name,something ``` > **Note:** Importing requires `dynamodb:DescribeTable` in addition to `dynamodb:GetItem`. The DescribeTable call is used to recover the key attribute names and types from the table's schema. > **Note:** If a hash key or range key value contains the separator character (`,`), use the `import` block with the `identity` attribute. The legacy `pulumi import` command and `id`-based `import` block cannot disambiguate separators from value content. For Binary (`B`) key attributes, the value in the import ID and the identity attribute must be standard base64.package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.dynamodb.Table; import com.pulumi.aws.dynamodb.TableArgs; import com.pulumi.aws.dynamodb.inputs.TableAttributeArgs; import com.pulumi.aws.dynamodb.TableItem; import com.pulumi.aws.dynamodb.TableItemArgs; import java.util.ArrayList; import java.util.Arrays; 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 exampleTable = new Table("exampleTable", TableArgs.builder() .attributes(TableAttributeArgs.builder() .name("exampleHashKey") .type("S") .build()) .name("example-name") .readCapacity(10) .writeCapacity(10) .hashKey("exampleHashKey") .build()); var example = new TableItem("example", TableItemArgs.builder() .tableName(exampleTable.name()) .hashKey(exampleTable.hashKey()) .item(""" { \"exampleHashKey\": {\"S\": \"something\"}, \"one\": {\"N\": \"11111\"}, \"two\": {\"N\": \"22222\"}, \"three\": {\"N\": \"33333\"}, \"four\": {\"N\": \"44444\"} } """) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description TableItem(java.lang.String name)TableItem(java.lang.String name, TableItemArgs args)TableItem(java.lang.String name, TableItemArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TableItemget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TableItemState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>hashKey()com.pulumi.core.Output<java.lang.String>hashKeyValue()com.pulumi.core.Output<java.lang.String>item()com.pulumi.core.Output<java.util.Optional<java.lang.String>>rangeKey()com.pulumi.core.Output<java.lang.String>rangeKeyValue()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>tableName()
-
-
-
Constructor Detail
-
TableItem
public TableItem(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
TableItem
public TableItem(java.lang.String name, TableItemArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
TableItem
public TableItem(java.lang.String name, TableItemArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
hashKey
public com.pulumi.core.Output<java.lang.String> hashKey()
- Returns:
- Hash key to use for lookups and identification of the item
-
hashKeyValue
public com.pulumi.core.Output<java.lang.String> hashKeyValue()
- Returns:
- Canonical string representation of the hash key value. Binary values are base64-encoded; numbers and strings are taken verbatim.
-
item
public com.pulumi.core.Output<java.lang.String> item()
- Returns:
- JSON representation of a map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.
-
rangeKey
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> rangeKey()
- Returns:
- Range key to use for lookups and identification of the item. Required if there is range key defined in the table.
-
rangeKeyValue
public com.pulumi.core.Output<java.lang.String> rangeKeyValue()
- Returns:
- Canonical string representation of the range key value, when the table has a range key. Same encoding as `hashKeyValue`.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- 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.
-
tableName
public com.pulumi.core.Output<java.lang.String> tableName()
- Returns:
- Name or ARN of the table to contain the item. > **Note:** Names included in `item` are represented internally with everything but letters removed. There is the possibility of collisions if two names, once filtered, are the same. For example, the names `your-name-here` and `yournamehere` will overlap and cause an error.
-
get
public static TableItem get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable TableItemState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-