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

Defining SecurityGroupIngress in case of s3.get_object() #1

Open
mdalvi opened this issue Jul 21, 2020 · 0 comments
Open

Defining SecurityGroupIngress in case of s3.get_object() #1

mdalvi opened this issue Jul 21, 2020 · 0 comments

Comments

@mdalvi
Copy link

mdalvi commented Jul 21, 2020

You have defined AWS::EC2::SecurityGroupEgress with bucket SourcePrefixListId for LambdaS3Write but that gives it capability to write only. It ain't reading from the bucket!

Let's say we are interested in doing,

client = boto3.client('s3', REGION_NAME, config=botocore.config.Config(s3={'addressing_style':'path'}))",
obj = client .get_object(Bucket=bucketname, Key=filename)

How would you define your AWS::EC2::SecurityGroupIngress condition that could enable reading from the same bucket?

"LambdaSecurityGroup": {
            "Type": "AWS::EC2::SecurityGroup",
            "Properties": {
                "GroupDescription": "Security Group for Lambda Egress",
                "VpcId": {
                    "Fn::GetAtt": [
                        "VPC",
                        "Outputs.VPC"
                    ]
                },
                "SecurityGroupEgress": [
                    {
                        "DestinationPrefixListId": {
                            "Ref": "S3EndpointPrefixList"
                        },
                        "IpProtocol": "-1"
                    }
                ],
                "SecurityGroupIngress": [
                    {
                        "SourcePrefixListId": {
                            "Ref": "S3EndpointPrefixList"
                        },
                        "IpProtocol": "-1"
                    }
                ]
            }
        },

I tried above, but doesn't work!

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

1 participant