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

aws-cloudformation bundles aws-sdk #2951

Closed
rix0rrr opened this issue Jun 20, 2019 · 6 comments · Fixed by #3027 or MechanicalRock/tech-radar#14 · May be fixed by MechanicalRock/cdk-constructs#5, MechanicalRock/cdk-constructs#6 or MechanicalRock/cdk-constructs#7
Assignees
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation bug This issue is a bug.

Comments

@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 20, 2019

The AWS CloudFormation library depends on and bundles the aws-sdk library, just for some service metadata.

It should not do that.

@rix0rrr rix0rrr added bug This issue is a bug. @aws-cdk/aws-cloudformation Related to AWS CloudFormation labels Jun 20, 2019
@RomainMuller
Copy link
Contributor

Is that not just a dev-dependency?

@eladb
Copy link
Contributor

eladb commented Jun 20, 2019

This is worrying.

How about we introduce this as a separate experimental module? I am concerned that this is at the bottom of our dependency graph.

@jogold, FYI

@eladb eladb self-assigned this Jun 20, 2019
@eladb
Copy link
Contributor

eladb commented Jun 20, 2019

I am taking care of this.

@jogold
Copy link
Contributor

jogold commented Jun 20, 2019

The only reason why aws-sdk is declared as a dependency is to derive IAM statements from SDK service/actions:
https://github.com/awslabs/aws-cdk/blob/4f13e18172c677b3f34f1c51f64c50bb9f4b4e24/packages/%40aws-cdk/aws-cloudformation/lib/aws-custom-resource.ts#L182-L193

Alternatives:

  • find another way to map SDK service/actions to IAM statements
  • do not derive statements from SDK service/actions and force users to always add the proper statements to the AwsCustomResource construct

@eladb
Copy link
Contributor

eladb commented Jun 20, 2019

@jogold thanks for chiming in. This doesn't sound like the right tradeoff.

@eladb
Copy link
Contributor

eladb commented Jun 20, 2019

@jogold are you available for a quick chat on Gitter?

eladb pushed a commit that referenced this issue Jun 24, 2019
Extract the AwsCustomResource construct to a separate module
called @aws-cdk/customresources, dedicated to special custom resources
such as this one.

Fixes #2951
eladb pushed a commit that referenced this issue Jun 24, 2019
Extract the AwsCustomResource construct to a separate module
called @aws-cdk/customresources, dedicated to special custom resources
such as this one.

Fixes #2951
eladb pushed a commit that referenced this issue Jun 24, 2019
Extract the AwsCustomResource construct to a separate module called @aws-cdk/custom-resources, dedicated to special custom resources such as this one.

Also, stop bundling the entire AWS SDK and instead extract `apis/metadata.json` during build time which fixes #2951.

BREAKING CHANGE: The `AwsCustomResource` class was moved to a new module called @aws-cdk/custom-resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment