반응형
CloudFormation은 내 DynamoDB 생성 JSON이 유효하지 않다고 주장하지만 .. 방법을 볼 수 없습니다.
다음은 Troposphere에서 생성 한 JSON (의 DynamoDB 부분)입니다.
"sandbox": {
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "audit_id",
"AttributeType": "S"
},
{
"AttributeName": "status",
"AttributeType": "S"
},
{
"AttributeName": "filename",
"AttributeType": "S"
},
{
"AttributeName": "file_detected_dt",
"AttributeType": "S"
},
{
"AttributeName": "time_taken",
"AttributeType": "N"
},
{
"AttributeName": "number_rows_processed_file",
"AttributeType": "N"
},
{
"AttributeName": "number_rows_created_db",
"AttributeType": "N"
},
{
"AttributeName": "info_messages",
"AttributeType": "S"
}
],
"KeySchema": [
{
"AttributeName": "audit_id",
"KeyType": "HASH"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": {
"Ref": "ReadCapacityUnits"
},
"WriteCapacityUnits": {
"Ref": "WriteCapacityUnits"
}
}
},
"Type": "AWS::DynamoDB::Table"
}
CloudFormation은 VPC를 스핀 업하려고 할 때 다음 오류를 표시 Property AttributeDefinitions is inconsistent with the KeySchema of the table and the secondary indexes
합니다..
하지만 ... 그렇습니까? 나는 audit_id
고독한 키로 지정 하고 있으며 확실히 AttributeDefinitions 목록 내에 존재합니다. 저는 CF (및 Dynamo)를 처음 접했기 때문에 매우 명백한 것을 놓치고있을 수 있지만 현재로서는 분명하지 않습니다.
나는 주위를 훑어 보았고이 오류에 대한 언급을 한 번만 찾았으며 CF 자체가 아닌 개발자와 CF 사이의 계층과 더 관련이 있습니다.
누구든지 내 템플릿의 문제점을 지적 할 수 있습니까?
This was down to a misunderstanding on my part regarding DynamoDB. The only attributes that should be defined here are those that will be used as keys. Thus, changing the AttributeDefinitions array to the following solved the problem:
"AttributeDefinitions": [
{
"AttributeName": "audit_id",
"AttributeType": "S"
}
]
반응형
'code' 카테고리의 다른 글
이 ADL 예제에 대해 Bjarne이 틀렸습니까? 아니면 컴파일러 버그가 있습니까? (0) | 2020.10.07 |
---|---|
gulp 이벤트에서 console.log를 stdout으로 (0) | 2020.10.07 |
wpf에서 창 내 요소의 절대 위치 가져 오기 (0) | 2020.10.07 |
Oracle SQL에서 두 날짜 / 시간의 차이 계산 (0) | 2020.10.07 |
C #에서 Bitmap 개체를 사용하여 이미지 형식 찾기 (0) | 2020.10.07 |