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

Allow SDKAlias to use nested objects for physical id and return values #34

Merged
merged 2 commits into from
Mar 7, 2019

Conversation

toshke
Copy link
Contributor

@toshke toshke commented Jun 29, 2018

Enhancements

In SDKAlias function, if object returned from API is more than 1 level deep, it was not possible to get nested object properties. Concrete example that I needed this functionality for is writing custom resource for creating AmazonCognito User Pool Client, where response data is nested under UserPoolClient map. (Example below)

Create: CfnLambda.SDKAlias({
    api: CognitoApi,
    method: 'createUserPoolClient',
    returnAttrs: [
      'UserPoolClient.ClientId',
      'UserPoolClient.CreationDate',
      'UserPoolClient.LastModifiedDate'
    ],
    returnPhysicalId: 'UserPoolClient.ClientId'
  }),

This pull request allows pulling physicalResourceId and query-able properties with Fn::GetAtt by using dot notation to select nested object properties from SDK call result.

Updated aws-sdk version

Essentially, feature above is being tested with custom resource for Amazon Cognito User Pool Client management. Without bumping up the aws-sdk version, I would get parameter validation errors

Fix

In SDKAlias section, README shows returnKeys as option key to define which API response fields should be mapped to data accessible with Fn::GetAtt cfn function. However, looking at the source code itself, seems like returnAttrs is actual key being used. README has been updated to reflect reality of the source code

…urceId"

Allow keyFilter to have complex object keys given.

Update README doco for SdkAlis

Updated README to reflect reality of `returnAttrs` option key for `SDKAlias` method.

Update aws-sdk version

update readme
@andrew-templeton
Copy link
Owner

I've got a bunch of work today but I'll be deploying this into main-line. Good idea!

@toshke
Copy link
Contributor Author

toshke commented Jul 2, 2018

@andrew-templeton great, looking forward to it - this way I don't have to link vendored version in package.json, thanks!

@toshke
Copy link
Contributor Author

toshke commented Jan 3, 2019

@andrew-templeton any updates on this, any chance this gets published?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants