question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

value_from dynamo query

See original GitHub issue

Currently value_from supports http requests and s3 buckets, but this can cause problems with large files. it would be nice to have the option to store these large files in dynamo and to be able to query it using value_from.

for example


policies:
  - name: vpc-with-dynamodb-value-from
    resource: vpc
    filters:
      - type: value
        key: 'tag:Name'
        value_from:
          url: 'dynamodb:us-east-1:644160558196:table/test'
          format: json
          query: 
            KeyConditionExpression: '#n2 = :v1'
            FilterExpression: 'contains(#n0.#n1, :v0)'
            ExpressionAttributeNames: {'#n0': 'exceptions', '#n1': 'exception1', '#n2': 'test'}
            ExpressionAttributeValues: {':v0': 'testing-vpc', ':v1': '1111111111' }
          expr: '[0].exceptions.exception1'
        op: in

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
kapiltcommented, Oct 21, 2020

your aws resources are already available over public http, the difference is protecting the access via IAM for authn/authz, you can do the same with api gw (iam auth).

thats two different native solutions, break up your s3 files to not be full database dumps but policy/env specific values, or front the data with an api gw/http endpoint. for the later we can add support for an auth mode (iam) to sign requests.

1reaction
howbazaarcommented, Oct 20, 2020

I’ve been thinking on this, and really just giving an outsider’s perspective to the approach.

I can understand the desire to move from a single large file to particular database queries. However I don’t think that custodian is the right place to provide that functionality.

It seems to me that a simple approach would be to have an api gateway -> lambda that could produce the HTTP response that the value_from filter already understands would be the best apprach. This should be pretty simple to implement, and keeps the database interactions isolated from custodian.

Having DB queries in policies feels like the wrong thing to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query - Amazon DynamoDB - AWS Documentation
Query · DynamoDB calculates the number of read capacity units consumed based on item size, not on the amount of data that is...
Read more >
Getting the latest value from DynamoDB table - Stack Overflow
I was able to figure it out so thought I'd post it here for anyone looking for the answer. The way I had...
Read more >
Get and Put data Using Lambda and DynamoDB, simple and ...
Our main goal is to READ some values (data) from DynamoDB and also ... to let the NodeJS compiler know that we will...
Read more >
Using Amazon DynamoDb with the AWS .NET API Part 6
In this post we'll investigate how to run queries against the data set in a DynamoDb table. Like in the two posts before...
Read more >
Query DynamoDB table using API Gateway - YouTube
Welcome to part 35 of the tutorial series on Amazon API Gateway. In this tutorial, how to query the DynamoDB table using API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found