Comments (7)
resource "awscc_dynamodb_table" "main" {
table_name = "dynamodb_table_name"
key_schema = {
attribute_name = "UserId"
key_type = "HASH"
}
attribute_definitions = [{
attribute_name = "UserId"
attribute_type = "S"
}]
billing_mode = "PAY_PER_REQUEST"
}
rg "CloudControl DesiredState" output.log | jq '.value | fromjson'
{
"AttributeDefinitions": [
{
"AttributeName": "UserId",
"AttributeType": "S"
}
],
"BillingMode": "PAY_PER_REQUEST",
"KeySchema": {
"attribute_name": "UserId", # ⚠️
"key_type": "HASH" # ⚠️
},
"TableName": "dynamodb_table_name"
}
With key_schema
being treated as a map(string)
the translator does not translate the Terraform names back to CloudFormation names.
from terraform-provider-awscc.
@wellsiau-aws The current working version of the schema is below. The original example has an incorrect sse_type of AWSKMS
.
- The current schema enforces the members of
key_schema
to match theattribute_definitions
which is from the expectation on theAWS::DynamoDB::Table
spec. This shouldn't be the case. - key_schema is expecting a JSON string format and doesn't take the snake cased arguments.
resource "awscc_dynamodb_table" "main" {
table_name = "dynamodb_table_name"
key_schema = jsonencode([{
AttributeName = "UserId"
KeyType = "HASH"
}])
attribute_definitions = [{
attribute_name = "UserId"
attribute_type = "S"
}]
billing_mode = "PROVISIONED"
provisioned_throughput = {
read_capacity_units = 20
write_capacity_units = 20
}
deletion_protection_enabled = true
sse_specification = {
sse_enabled = true
sse_type = "KMS"
}
time_to_live_specification = {
attribute_name = "TimeToExist"
enabled = false
}
table_class = "STANDARD"
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
from terraform-provider-awscc.
@kadrach @quixoticmonk thank you for your input!
I believe there are two separate problem here:
key_schema
attribute being treated as map(string) as described here- CCAPI write handler requires that
key_schema
attribute value to matches theattribute_definitions
as described here
@quixoticmonk , I suggest to open a new issue to record your problem since that also another upstream AWS issue.
from terraform-provider-awscc.
Key Schema object:
from terraform-provider-awscc.
AWSCC handler for DynamoDB Table: https://github.com/hashicorp/terraform-provider-awscc/blob/ce1ad5105c8f463339880e0dd2d00395cd2f40a6/internal/aws/dynamodb/table_resource_gen.go#L472C1-L474C22
Notice how the element type is string
"key_schema": schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Required: true,
from terraform-provider-awscc.
Perhaps this part of the Key Schema is causing confusion on the auto-generation because it declare either an array or an object.
from terraform-provider-awscc.
Having this error too in latest version of provider (0.55.0)
from terraform-provider-awscc.
Related Issues (20)
- Resource Suppression: `awscc_cleanrooms_id_namespace_association`
- awscc_ecr_repository_creation_template: Error: Provider returned invalid result object after apply HOT 1
- Build with Go 1.22.6
- awscc_glue_trigger: Plan fails with tag object expected to be string type
- awscc_ec2_vpc resource and state don't converge HOT 2
- Missing resource `awscc_timestream_influx_db_instance`
- awscc_controltower_enabled_baseline - resource suppression
- awscc_ecr_repository: drift detected between subsequent terraform applies HOT 3
- conversation_log_settings always shows change for resource awscc_lex_bot_alias HOT 4
- awscc_lex_bot_alias lifecycle {ignore_changes} does not ignore changes HOT 1
- Ignore empty patch document for Cloud Control API UpdateResource
- awscc_iotsitewise_asset_model resource detects drift on unchanged config in subsequent run and never completes HOT 7
- awscc_iotwireless_wireless_gateway resource not updating AWS tags
- Attempting to change description field in awscc_iotsitewise_asset_model resource throws AWS SDK Go Service Operation Incomplete error HOT 6
- Resource Suppression: `awscc_apigatewayv2_integration`
- Implement awscc_sts_caller_identity HOT 3
- awscc_s3_bucket: drift detected between subsequent terraform applies HOT 1
- Build with Go 1.23.0
- awscc_cloudformation_stack_set with template_url parameter set cannot be updated
- `changelog-newversion` GitHub action failing after release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-awscc.