Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource aws.dynamodb.globalTables doesn't include the info for v.2019 tables #2913

Open
mm-weber opened this issue Dec 22, 2023 · 2 comments
Assignees
Labels
aws bug Something isn't working enhancement New feature or request

Comments

@mm-weber
Copy link
Contributor

mm-weber commented Dec 22, 2023

Describe the bug
Regarding aws.dynamodb.globalTables

Desired result
We need to include the info provided by the AWS cli command below to the resource, so it matches the info for the old 2017 GlobalTable resources:

Example of out of a 2019 (new) Global Table using aws dynamodb describe-table-replica-auto-scaling resource

aws dynamodb describe-table-replica-auto-scaling --table-name "GameScores" --region us-east-2

{
    "TableAutoScalingDescription": {
        "TableName": "GameScores",
        "TableStatus": "ACTIVE",
        "Replicas": [
            {
                "RegionName": "us-east-1",
                "GlobalSecondaryIndexes": [
                    {
                        "IndexName": "GameTitleIndex",
                        "IndexStatus": "ACTIVE",
                        "ProvisionedReadCapacityAutoScalingSettings": {
                            "AutoScalingDisabled": true,
                            "ScalingPolicies": []
                        },
                        "ProvisionedWriteCapacityAutoScalingSettings": {
                            "AutoScalingDisabled": true,
                            "ScalingPolicies": []
                        }
                    }
                ],
                "ReplicaProvisionedReadCapacityAutoScalingSettings": {
                    "AutoScalingDisabled": true,
                    "ScalingPolicies": []
                },
                "ReplicaProvisionedWriteCapacityAutoScalingSettings": {
                    "AutoScalingDisabled": true,
                    "ScalingPolicies": []
                },
                "ReplicaStatus": "ACTIVE"
            },
SNIP...
@mm-weber
Copy link
Contributor Author

mm-weber commented Dec 22, 2023

Example of v.2017 (old) Global Table in the cnspec:

cnspec> aws.dynamodb.globalTables {*}
aws.dynamodb.globalTables: [
  0: {
    name: "myTable"
    replicaSettings: [
      0: {
        RegionName: "us-east-1"
        ReplicaBillingModeSummary: null
        ReplicaGlobalSecondaryIndexSettings: null
        ReplicaProvisionedReadCapacityAutoScalingSettings: {
          AutoScalingDisabled: true
          AutoScalingRoleArn: null
          MaximumUnits: null
          MinimumUnits: null
          ScalingPolicies: null
        }
        ReplicaProvisionedReadCapacityUnits: 1.000000
        ReplicaProvisionedWriteCapacityAutoScalingSettings: {
          AutoScalingDisabled: null
          AutoScalingRoleArn: "arn:aws:iam::162854405951:role/aws-service-role/dynamodb.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_DynamoDBTable"
          MaximumUnits: 5.000000
          MinimumUnits: 1.000000
          ScalingPolicies: [
            0: {
              PolicyName: "DynamoDBWriteCapacityUtilization:table/myTable"
              TargetTrackingScalingPolicyConfiguration: {
                DisableScaleIn: null
                ScaleInCooldown: null
                ScaleOutCooldown: null
                TargetValue: 70.000000
              }
            }
          ]
        }
        ReplicaProvisionedWriteCapacityUnits: 1.000000
        ReplicaStatus: "ACTIVE"
        ReplicaTableClassSummary: null
      }
      1: {
        RegionName: "us-east-2"
        ReplicaBillingModeSummary: null
        ReplicaGlobalSecondaryIndexSettings: null
        ReplicaProvisionedReadCapacityAutoScalingSettings: {
          AutoScalingDisabled: true
          AutoScalingRoleArn: null
          MaximumUnits: null
          MinimumUnits: null
          ScalingPolicies: null
        }
SNIP...

@mm-weber mm-weber added bug Something isn't working aws enhancement New feature or request labels Dec 22, 2023
@vjeffrey vjeffrey self-assigned this Feb 2, 2024
@mm-weber
Copy link
Contributor Author

mm-weber commented Feb 20, 2024

"GlobalTable-Version-2019 is not recognized by aws.dynamodb.globalTables

You can use this Terraform snippet for testing cloud-security-testing/aws/snippetsTesting/dynamodbGlobalTables

cnspec> aws.dynamodb.globalTables
aws.dynamodb.globalTables: [
  0: aws.dynamodb.globaltable name="globalTable-old-2017"
]
cnspec> 
(base) manuel@manuel-ThinkPad-X1-Carbon-Gen-9
 /home/manuel/projects/cloud-security-testing/aws/snippetsTesting/dynamodbGlobalTables (manuel/improve-aws-cloud*)$ aws dynamodb describe-table-replica-auto-scaling --table-name "GlobalTable-Version-2019" --region us-east-1
{
    "TableAutoScalingDescription": {
        "TableName": "GlobalTable-Version-2019",
        "TableStatus": "ACTIVE",
        "Replicas": [
            {
                "RegionName": "us-east-1",
                "GlobalSecondaryIndexes": [
                    {
                        "IndexName": "GameTitleIndex",
                        "IndexStatus": "ACTIVE",
                        "ProvisionedReadCapacityAutoScalingSettings": {
                            "AutoScalingDisabled": true,
                            "ScalingPolicies": []
                        },
                        "ProvisionedWriteCapacityAutoScalingSettings": {
                            "AutoScalingDisabled": true,
                            "ScalingPolicies": []
                        }
                    }
                ],
                "ReplicaProvisionedReadCapacityAutoScalingSettings": {
                    "AutoScalingDisabled": true,
                    "ScalingPolicies": []
                },
                "ReplicaProvisionedWriteCapacityAutoScalingSettings": {
                    "AutoScalingDisabled": true,
                    "ScalingPolicies": []
                },
                "ReplicaStatus": "ACTIVE"
            },
            {
                "RegionName": "us-east-2",
                "GlobalSecondaryIndexes": [
                    {
                        "IndexName": "GameTitleIndex",
                        "IndexStatus": "ACTIVE",
                        "ProvisionedReadCapacityAutoScalingSettings": {
                            "AutoScalingDisabled": true,
                            "ScalingPolicies": []
                        },
                        "ProvisionedWriteCapacityAutoScalingSettings": {
                            "AutoScalingDisabled": true,
                            "ScalingPolicies": []
                        }
                    }
                ],
                "ReplicaProvisionedReadCapacityAutoScalingSettings": {
                    "AutoScalingDisabled": true,
                    "ScalingPolicies": []
                },
                "ReplicaProvisionedWriteCapacityAutoScalingSettings": {
                    "AutoScalingDisabled": true,
                    "ScalingPolicies": []
                },
                "ReplicaStatus": "ACTIVE"
            },
            {
                "RegionName": "us-west-2",
                "GlobalSecondaryIndexes": [
                    {
                        "IndexName": "GameTitleIndex",
                        "IndexStatus": "ACTIVE",
                        "ProvisionedReadCapacityAutoScalingSettings": {
                            "AutoScalingDisabled": true,
                            "ScalingPolicies": []
                        },
                        "ProvisionedWriteCapacityAutoScalingSettings": {
                            "AutoScalingDisabled": true,
                            "ScalingPolicies": []
                        }
                    }
                ],
                "ReplicaProvisionedReadCapacityAutoScalingSettings": {
                    "AutoScalingDisabled": true,
                    "ScalingPolicies": []
                },
                "ReplicaProvisionedWriteCapacityAutoScalingSettings": {
                    "AutoScalingDisabled": true,
                    "ScalingPolicies": []
                },
                "ReplicaStatus": "ACTIVE"
            }
        ]
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants