getTableItem

Data source for retrieving a value from an AWS DynamoDB table.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.dynamodb.DynamodbFunctions;
import com.pulumi.aws.dynamodb.inputs.GetTableItemArgs;
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) {
final var test = DynamodbFunctions.getTableItem(GetTableItemArgs.builder()
.tableName(aws_dynamodb_table.example().name())
.expressionAttributeNames(Map.of("#P", "Percentile"))
.projectionExpression("#P")
.key("""
{
"hashKey": {"S": "example"}
}
""")
.build());
}
}

Return

A collection of values returned by getTableItem.

Parameters

argument

A collection of arguments for invoking getTableItem.


suspend fun getTableItem(expressionAttributeNames: Map<String, String>? = null, key: String, projectionExpression: String? = null, tableName: String): GetTableItemResult

Return

A collection of values returned by getTableItem.

Parameters

expressionAttributeNames
key

A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve. For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key. The following arguments are optional:

projectionExpression

A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas. If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.

tableName

The name of the table containing the requested item.

See also


Return

A collection of values returned by getTableItem.

Parameters

argument

Builder for com.pulumi.aws.dynamodb.kotlin.inputs.GetTableItemPlainArgs.

See also