Struct aws_sdk_dynamodb::operation::create_table::CreateTableInput
source · #[non_exhaustive]pub struct CreateTableInput {Show 14 fields
pub attribute_definitions: Option<Vec<AttributeDefinition>>,
pub table_name: Option<String>,
pub key_schema: Option<Vec<KeySchemaElement>>,
pub local_secondary_indexes: Option<Vec<LocalSecondaryIndex>>,
pub global_secondary_indexes: Option<Vec<GlobalSecondaryIndex>>,
pub billing_mode: Option<BillingMode>,
pub provisioned_throughput: Option<ProvisionedThroughput>,
pub stream_specification: Option<StreamSpecification>,
pub sse_specification: Option<SseSpecification>,
pub tags: Option<Vec<Tag>>,
pub table_class: Option<TableClass>,
pub deletion_protection_enabled: Option<bool>,
pub resource_policy: Option<String>,
pub on_demand_throughput: Option<OnDemandThroughput>,
}
Expand description
Represents the input of a CreateTable
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.attribute_definitions: Option<Vec<AttributeDefinition>>
An array of attributes that describe the key schema for the table and indexes.
table_name: Option<String>
The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
key_schema: Option<Vec<KeySchemaElement>>
Specifies the attributes that make up the primary key for a table or an index. The attributes in KeySchema
must also be defined in the AttributeDefinitions
array. For more information, see Data Model in the Amazon DynamoDB Developer Guide.
Each KeySchemaElement
in the array is composed of:
-
AttributeName
- The name of this key attribute. -
KeyType
- The role that the key attribute will assume:-
HASH
- partition key -
RANGE
- sort key
-
The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
For a simple primary key (partition key), you must provide exactly one element with a KeyType
of HASH
.
For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a KeyType
of HASH
, and the second element must have a KeyType
of RANGE
.
For more information, see Working with Tables in the Amazon DynamoDB Developer Guide.
local_secondary_indexes: Option<Vec<LocalSecondaryIndex>>
One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.
Each local secondary index in the array includes the following:
-
IndexName
- The name of the local secondary index. Must be unique only for this table. -
KeySchema
- Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table. -
Projection
- Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:-
ProjectionType
- One of the following:-
KEYS_ONLY
- Only the index and primary keys are projected into the index. -
INCLUDE
- Only the specified table attributes are projected into the index. The list of projected attributes is inNonKeyAttributes
. -
ALL
- All of the table attributes are projected into the index.
-
-
NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided inNonKeyAttributes
, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
-
global_secondary_indexes: Option<Vec<GlobalSecondaryIndex>>
One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:
-
IndexName
- The name of the global secondary index. Must be unique only for this table. -
KeySchema
- Specifies the key schema for the global secondary index. -
Projection
- Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:-
ProjectionType
- One of the following:-
KEYS_ONLY
- Only the index and primary keys are projected into the index. -
INCLUDE
- Only the specified table attributes are projected into the index. The list of projected attributes is inNonKeyAttributes
. -
ALL
- All of the table attributes are projected into the index.
-
-
NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided inNonKeyAttributes
, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
-
-
ProvisionedThroughput
- The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.
billing_mode: Option<BillingMode>
Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.
-
PROVISIONED
- We recommend usingPROVISIONED
for predictable workloads.PROVISIONED
sets the billing mode to Provisioned capacity mode. -
PAY_PER_REQUEST
- We recommend usingPAY_PER_REQUEST
for unpredictable workloads.PAY_PER_REQUEST
sets the billing mode to On-demand capacity mode.
provisioned_throughput: Option<ProvisionedThroughput>
Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the UpdateTable
operation.
If you set BillingMode as PROVISIONED
, you must specify this property. If you set BillingMode as PAY_PER_REQUEST
, you cannot specify this property.
For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.
stream_specification: Option<StreamSpecification>
The settings for DynamoDB Streams on the table. These settings consist of:
-
StreamEnabled
- Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false). -
StreamViewType
- When an item in the table is modified,StreamViewType
determines what information is written to the table's stream. Valid values forStreamViewType
are:-
KEYS_ONLY
- Only the key attributes of the modified item are written to the stream. -
NEW_IMAGE
- The entire item, as it appears after it was modified, is written to the stream. -
OLD_IMAGE
- The entire item, as it appeared before it was modified, is written to the stream. -
NEW_AND_OLD_IMAGES
- Both the new and the old item images of the item are written to the stream.
-
sse_specification: Option<SseSpecification>
Represents the settings used to enable server-side encryption.
A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB.
table_class: Option<TableClass>
The table class of the new table. Valid values are STANDARD
and STANDARD_INFREQUENT_ACCESS
.
deletion_protection_enabled: Option<bool>
Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
resource_policy: Option<String>
An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.
When you attach a resource-based policy while creating a table, the policy application is strongly consistent.
The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see Resource-based policy considerations.
You need to specify the CreateTable
and PutResourcePolicy
IAM actions for authorizing a user to create a table with a resource-based policy.
on_demand_throughput: Option<OnDemandThroughput>
Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify MaxReadRequestUnits
, MaxWriteRequestUnits
, or both.
Implementations§
source§impl CreateTableInput
impl CreateTableInput
sourcepub fn attribute_definitions(&self) -> &[AttributeDefinition]
pub fn attribute_definitions(&self) -> &[AttributeDefinition]
An array of attributes that describe the key schema for the table and indexes.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .attribute_definitions.is_none()
.
sourcepub fn table_name(&self) -> Option<&str>
pub fn table_name(&self) -> Option<&str>
The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.
sourcepub fn key_schema(&self) -> &[KeySchemaElement]
pub fn key_schema(&self) -> &[KeySchemaElement]
Specifies the attributes that make up the primary key for a table or an index. The attributes in KeySchema
must also be defined in the AttributeDefinitions
array. For more information, see Data Model in the Amazon DynamoDB Developer Guide.
Each KeySchemaElement
in the array is composed of:
-
AttributeName
- The name of this key attribute. -
KeyType
- The role that the key attribute will assume:-
HASH
- partition key -
RANGE
- sort key
-
The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
For a simple primary key (partition key), you must provide exactly one element with a KeyType
of HASH
.
For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a KeyType
of HASH
, and the second element must have a KeyType
of RANGE
.
For more information, see Working with Tables in the Amazon DynamoDB Developer Guide.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .key_schema.is_none()
.
sourcepub fn local_secondary_indexes(&self) -> &[LocalSecondaryIndex]
pub fn local_secondary_indexes(&self) -> &[LocalSecondaryIndex]
One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.
Each local secondary index in the array includes the following:
-
IndexName
- The name of the local secondary index. Must be unique only for this table. -
KeySchema
- Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table. -
Projection
- Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:-
ProjectionType
- One of the following:-
KEYS_ONLY
- Only the index and primary keys are projected into the index. -
INCLUDE
- Only the specified table attributes are projected into the index. The list of projected attributes is inNonKeyAttributes
. -
ALL
- All of the table attributes are projected into the index.
-
-
NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided inNonKeyAttributes
, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
-
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .local_secondary_indexes.is_none()
.
sourcepub fn global_secondary_indexes(&self) -> &[GlobalSecondaryIndex]
pub fn global_secondary_indexes(&self) -> &[GlobalSecondaryIndex]
One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:
-
IndexName
- The name of the global secondary index. Must be unique only for this table. -
KeySchema
- Specifies the key schema for the global secondary index. -
Projection
- Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:-
ProjectionType
- One of the following:-
KEYS_ONLY
- Only the index and primary keys are projected into the index. -
INCLUDE
- Only the specified table attributes are projected into the index. The list of projected attributes is inNonKeyAttributes
. -
ALL
- All of the table attributes are projected into the index.
-
-
NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided inNonKeyAttributes
, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
-
-
ProvisionedThroughput
- The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .global_secondary_indexes.is_none()
.
sourcepub fn billing_mode(&self) -> Option<&BillingMode>
pub fn billing_mode(&self) -> Option<&BillingMode>
Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.
-
PROVISIONED
- We recommend usingPROVISIONED
for predictable workloads.PROVISIONED
sets the billing mode to Provisioned capacity mode. -
PAY_PER_REQUEST
- We recommend usingPAY_PER_REQUEST
for unpredictable workloads.PAY_PER_REQUEST
sets the billing mode to On-demand capacity mode.
sourcepub fn provisioned_throughput(&self) -> Option<&ProvisionedThroughput>
pub fn provisioned_throughput(&self) -> Option<&ProvisionedThroughput>
Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the UpdateTable
operation.
If you set BillingMode as PROVISIONED
, you must specify this property. If you set BillingMode as PAY_PER_REQUEST
, you cannot specify this property.
For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.
sourcepub fn stream_specification(&self) -> Option<&StreamSpecification>
pub fn stream_specification(&self) -> Option<&StreamSpecification>
The settings for DynamoDB Streams on the table. These settings consist of:
-
StreamEnabled
- Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false). -
StreamViewType
- When an item in the table is modified,StreamViewType
determines what information is written to the table's stream. Valid values forStreamViewType
are:-
KEYS_ONLY
- Only the key attributes of the modified item are written to the stream. -
NEW_IMAGE
- The entire item, as it appears after it was modified, is written to the stream. -
OLD_IMAGE
- The entire item, as it appeared before it was modified, is written to the stream. -
NEW_AND_OLD_IMAGES
- Both the new and the old item images of the item are written to the stream.
-
sourcepub fn sse_specification(&self) -> Option<&SseSpecification>
pub fn sse_specification(&self) -> Option<&SseSpecification>
Represents the settings used to enable server-side encryption.
A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .tags.is_none()
.
sourcepub fn table_class(&self) -> Option<&TableClass>
pub fn table_class(&self) -> Option<&TableClass>
The table class of the new table. Valid values are STANDARD
and STANDARD_INFREQUENT_ACCESS
.
sourcepub fn deletion_protection_enabled(&self) -> Option<bool>
pub fn deletion_protection_enabled(&self) -> Option<bool>
Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
sourcepub fn resource_policy(&self) -> Option<&str>
pub fn resource_policy(&self) -> Option<&str>
An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.
When you attach a resource-based policy while creating a table, the policy application is strongly consistent.
The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see Resource-based policy considerations.
You need to specify the CreateTable
and PutResourcePolicy
IAM actions for authorizing a user to create a table with a resource-based policy.
sourcepub fn on_demand_throughput(&self) -> Option<&OnDemandThroughput>
pub fn on_demand_throughput(&self) -> Option<&OnDemandThroughput>
Sets the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify MaxReadRequestUnits
, MaxWriteRequestUnits
, or both.
source§impl CreateTableInput
impl CreateTableInput
sourcepub fn builder() -> CreateTableInputBuilder
pub fn builder() -> CreateTableInputBuilder
Creates a new builder-style object to manufacture CreateTableInput
.
Trait Implementations§
source§impl Clone for CreateTableInput
impl Clone for CreateTableInput
source§fn clone(&self) -> CreateTableInput
fn clone(&self) -> CreateTableInput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CreateTableInput
impl Debug for CreateTableInput
source§impl PartialEq for CreateTableInput
impl PartialEq for CreateTableInput
source§fn eq(&self, other: &CreateTableInput) -> bool
fn eq(&self, other: &CreateTableInput) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CreateTableInput
Auto Trait Implementations§
impl Freeze for CreateTableInput
impl RefUnwindSafe for CreateTableInput
impl Send for CreateTableInput
impl Sync for CreateTableInput
impl Unpin for CreateTableInput
impl UnwindSafe for CreateTableInput
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute
] value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
[Quirk
] value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition
] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);