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

Feature Request: Expose AWS SDK to client code #1796

Closed
lroling8350 opened this issue Feb 19, 2019 · 2 comments
Closed

Feature Request: Expose AWS SDK to client code #1796

lroling8350 opened this issue Feb 19, 2019 · 2 comments

Comments

@lroling8350
Copy link

It would be helpful if the AWS SDK configured by the cdk was exposed for use within a cdk app. (it may be already and i could find it while looking through the code)

The reason for the request is to query for resources between stacks in the app using the SDK. I could use a new instance of the SDK but it won't take advantage of some nice credential features such as --profile which are exposed via the CDK.

My use case for needing the SDK is as follows. I want to setup cloudfront with origin failover and have access to the s3 origins restricted to cloudfront using the OriginAccessIdentity. Since the replicated bucket is in another region i cannot use the import/export feature of cloudfront. To get around this the SDK could be queried after the stack with the identity is created and before the stack with the replicated bucket. My current option is to create the stack, manually get the CanonicalS3Id and hard code it in my config, then create the replicated stack.

I have seen several issues around cross region stacks which may solve this in a more elegant way making this feature request moot. There are so many great areas where escape hatches were created, this feels like it could be another one added to the list.

@rix0rrr
Copy link
Contributor

rix0rrr commented Feb 20, 2019

I don't know yet what this feature is going to look like, but exposing the AWS SDK at synthesis time is something we explicitly don't want to do. We'd like to think of the cloud app as a "pure function" of its inputs (code + config) to its output (a deployment description of the application). That's not to say we're going to make it impossible, but we're definitely not going to make it easy either :).

In the mean time, you should be able to fix your issue by writing a Custom Resource to do a cross-region call, retrieving whatever value you need, at deploy time.

@rix0rrr
Copy link
Contributor

rix0rrr commented Feb 20, 2019

Closing this issue because it's essentially a duplicate of #49

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

No branches or pull requests

2 participants