aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.51k stars 3.85k forks source link

[sam] AWS SAM Policies inside CDK #3896

Open rhboyd opened 5 years ago

rhboyd commented 5 years ago

:rocket: Feature Request

General Information

Description

The AWS SAM IAM Policy Templates should exist in the aws-SAM module so users can easily translate their SAM Templates into CDK

Proposed Solution

Naive approach, manually copy the templates. Smart approach, maybe find a way to load the policy definitions from the aws-sam repository.

nija-at commented 4 years ago

I suppose you're talking about this set of IAM policies - https://github.com/awslabs/serverless-application-model/blob/master/samtranslator/policy_templates_data/policy_templates.json

This would be a useful feature.

We'll need to think about the different ways the policy templates in the SAM repository may get added, updated or deleted and how that should to get reflected in a CDK app that uses them. The solution or approach to this problem would need to include these considerations.

simalexan commented 4 years ago

+1

rhboyd commented 4 years ago

I think this should be part of a larger epic to pull in the SAM Specification so we aren't asking SAM users to dump arbitrary json blobs into their templates.

mnugter commented 4 years ago

I have been referred to this issue because I have hit the limit of resources in a single template. Using inline resources would save a resource for each lambda function and would greatly help mitigating the problem with the significant increase in resources that are created with CDK.

+1

dlydiard commented 3 years ago

+1

aoffpo commented 3 years ago

+1

njlynch commented 3 years ago

Note: Please 👍 the main request, rather than leaving +1 comments; it's much easier to track and sort based on 👍 s. A comment which describes your use case is also helpful.

jackmcguire1 commented 3 years ago

bump, this may resolve the issue where the new CF importation module will be able to translate the AWS SAM SSM and pinpoint policies I am using within my CF stack, as they're are not generated correctly on CDK synth