dynamodb - only require nonkey attributes on INCLUDE

This commit is contained in:
Joshua Semar 2015-06-23 20:24:15 -05:00
parent 74386655a5
commit 7948aa720e
1 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er
ProjectionType: aws.String(lsi["projection_type"].(string)), ProjectionType: aws.String(lsi["projection_type"].(string)),
} }
if lsi["projection_type"] != "ALL" { if lsi["projection_type"] == "INCLUDE" {
non_key_attributes := []*string{} non_key_attributes := []*string{}
for _, attr := range lsi["non_key_attributes"].([]interface{}) { for _, attr := range lsi["non_key_attributes"].([]interface{}) {
non_key_attributes = append(non_key_attributes, aws.String(attr.(string))) non_key_attributes = append(non_key_attributes, aws.String(attr.(string)))
@ -570,7 +570,7 @@ func createGSIFromData(data *map[string]interface{}) dynamodb.GlobalSecondaryInd
ProjectionType: aws.String((*data)["projection_type"].(string)), ProjectionType: aws.String((*data)["projection_type"].(string)),
} }
if (*data)["projection_type"] != "ALL" { if (*data)["projection_type"] == "INCLUDE" {
non_key_attributes := []*string{} non_key_attributes := []*string{}
for _, attr := range (*data)["non_key_attributes"].([]interface{}) { for _, attr := range (*data)["non_key_attributes"].([]interface{}) {
non_key_attributes = append(non_key_attributes, aws.String(attr.(string))) non_key_attributes = append(non_key_attributes, aws.String(attr.(string)))