pub struct Builder { /* private fields */ }
Expand description

A builder for CreateTableInput.

Implementations§

Appends an item to attribute_definitions.

To override the contents of this collection use set_attribute_definitions.

An array of attributes that describe the key schema for the table and indexes.

Examples found in repository?
src/client.rs (line 1594)
1593
1594
1595
1596
        pub fn attribute_definitions(mut self, input: crate::model::AttributeDefinition) -> Self {
            self.inner = self.inner.attribute_definitions(input);
            self
        }

An array of attributes that describe the key schema for the table and indexes.

Examples found in repository?
src/client.rs (line 1602)
1598
1599
1600
1601
1602
1603
1604
        pub fn set_attribute_definitions(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::AttributeDefinition>>,
        ) -> Self {
            self.inner = self.inner.set_attribute_definitions(input);
            self
        }

The name of the table to create.

Examples found in repository?
src/client.rs (line 1607)
1606
1607
1608
1609
        pub fn table_name(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.table_name(input.into());
            self
        }

The name of the table to create.

Examples found in repository?
src/client.rs (line 1612)
1611
1612
1613
1614
        pub fn set_table_name(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_table_name(input);
            self
        }

Appends an item to key_schema.

To override the contents of this collection use set_key_schema.

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.

Examples found in repository?
src/client.rs (line 1636)
1635
1636
1637
1638
        pub fn key_schema(mut self, input: crate::model::KeySchemaElement) -> Self {
            self.inner = self.inner.key_schema(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 1659)
1655
1656
1657
1658
1659
1660
1661
        pub fn set_key_schema(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::KeySchemaElement>>,
        ) -> Self {
            self.inner = self.inner.set_key_schema(input);
            self
        }

Appends an item to local_secondary_indexes.

To override the contents of this collection use set_local_secondary_indexes.

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 in NonKeyAttributes.

      • 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 in NonKeyAttributes, 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.

Examples found in repository?
src/client.rs (line 1683)
1682
1683
1684
1685
        pub fn local_secondary_indexes(mut self, input: crate::model::LocalSecondaryIndex) -> Self {
            self.inner = self.inner.local_secondary_indexes(input);
            self
        }

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 in NonKeyAttributes.

      • 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 in NonKeyAttributes, 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.

Examples found in repository?
src/client.rs (line 1706)
1702
1703
1704
1705
1706
1707
1708
        pub fn set_local_secondary_indexes(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::LocalSecondaryIndex>>,
        ) -> Self {
            self.inner = self.inner.set_local_secondary_indexes(input);
            self
        }

Appends an item to global_secondary_indexes.

To override the contents of this collection use set_global_secondary_indexes.

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 in NonKeyAttributes.

      • 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 in NonKeyAttributes, 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.

Examples found in repository?
src/client.rs (line 1733)
1729
1730
1731
1732
1733
1734
1735
        pub fn global_secondary_indexes(
            mut self,
            input: crate::model::GlobalSecondaryIndex,
        ) -> Self {
            self.inner = self.inner.global_secondary_indexes(input);
            self
        }

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 in NonKeyAttributes.

      • 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 in NonKeyAttributes, 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.

Examples found in repository?
src/client.rs (line 1756)
1752
1753
1754
1755
1756
1757
1758
        pub fn set_global_secondary_indexes(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::GlobalSecondaryIndex>>,
        ) -> Self {
            self.inner = self.inner.set_global_secondary_indexes(input);
            self
        }

Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.

  • PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned Mode.

  • PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode.

Examples found in repository?
src/client.rs (line 1765)
1764
1765
1766
1767
        pub fn billing_mode(mut self, input: crate::model::BillingMode) -> Self {
            self.inner = self.inner.billing_mode(input);
            self
        }

Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.

  • PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned Mode.

  • PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode.

Examples found in repository?
src/client.rs (line 1777)
1773
1774
1775
1776
1777
1778
1779
        pub fn set_billing_mode(
            mut self,
            input: std::option::Option<crate::model::BillingMode>,
        ) -> Self {
            self.inner = self.inner.set_billing_mode(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 1787)
1783
1784
1785
1786
1787
1788
1789
        pub fn provisioned_throughput(
            mut self,
            input: crate::model::ProvisionedThroughput,
        ) -> Self {
            self.inner = self.inner.provisioned_throughput(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 1797)
1793
1794
1795
1796
1797
1798
1799
        pub fn set_provisioned_throughput(
            mut self,
            input: std::option::Option<crate::model::ProvisionedThroughput>,
        ) -> Self {
            self.inner = self.inner.set_provisioned_throughput(input);
            self
        }

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 for StreamViewType 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.

Examples found in repository?
src/client.rs (line 1812)
1811
1812
1813
1814
        pub fn stream_specification(mut self, input: crate::model::StreamSpecification) -> Self {
            self.inner = self.inner.stream_specification(input);
            self
        }

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 for StreamViewType 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.

Examples found in repository?
src/client.rs (line 1830)
1826
1827
1828
1829
1830
1831
1832
        pub fn set_stream_specification(
            mut self,
            input: std::option::Option<crate::model::StreamSpecification>,
        ) -> Self {
            self.inner = self.inner.set_stream_specification(input);
            self
        }

Represents the settings used to enable server-side encryption.

Examples found in repository?
src/client.rs (line 1835)
1834
1835
1836
1837
        pub fn sse_specification(mut self, input: crate::model::SseSpecification) -> Self {
            self.inner = self.inner.sse_specification(input);
            self
        }

Represents the settings used to enable server-side encryption.

Examples found in repository?
src/client.rs (line 1843)
1839
1840
1841
1842
1843
1844
1845
        pub fn set_sse_specification(
            mut self,
            input: std::option::Option<crate::model::SseSpecification>,
        ) -> Self {
            self.inner = self.inner.set_sse_specification(input);
            self
        }

Appends an item to tags.

To override the contents of this collection use set_tags.

A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB.

Examples found in repository?
src/client.rs (line 1852)
1851
1852
1853
1854
        pub fn tags(mut self, input: crate::model::Tag) -> Self {
            self.inner = self.inner.tags(input);
            self
        }

A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB.

Examples found in repository?
src/client.rs (line 1860)
1856
1857
1858
1859
1860
1861
1862
        pub fn set_tags(
            mut self,
            input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
        ) -> Self {
            self.inner = self.inner.set_tags(input);
            self
        }

The table class of the new table. Valid values are STANDARD and STANDARD_INFREQUENT_ACCESS.

Examples found in repository?
src/client.rs (line 1865)
1864
1865
1866
1867
        pub fn table_class(mut self, input: crate::model::TableClass) -> Self {
            self.inner = self.inner.table_class(input);
            self
        }

The table class of the new table. Valid values are STANDARD and STANDARD_INFREQUENT_ACCESS.

Examples found in repository?
src/client.rs (line 1873)
1869
1870
1871
1872
1873
1874
1875
        pub fn set_table_class(
            mut self,
            input: std::option::Option<crate::model::TableClass>,
        ) -> Self {
            self.inner = self.inner.set_table_class(input);
            self
        }

Consumes the builder and constructs a CreateTableInput.

Examples found in repository?
src/client.rs (line 1557)
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
        pub async fn customize(
            self,
        ) -> std::result::Result<
            crate::operation::customize::CustomizableOperation<
                crate::operation::CreateTable,
                aws_http::retry::AwsResponseRetryClassifier,
            >,
            aws_smithy_http::result::SdkError<crate::error::CreateTableError>,
        > {
            let handle = self.handle.clone();
            let operation = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            Ok(crate::operation::customize::CustomizableOperation { handle, operation })
        }

        /// Sends the request and returns the response.
        ///
        /// If an error occurs, an `SdkError` will be returned with additional details that
        /// can be matched against.
        ///
        /// By default, any retryable failures will be retried twice. Retry behavior
        /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
        /// set when configuring the client.
        pub async fn send(
            self,
        ) -> std::result::Result<
            crate::output::CreateTableOutput,
            aws_smithy_http::result::SdkError<crate::error::CreateTableError>,
        > {
            let op = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&self.handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            self.handle.client.call(op).await
        }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more