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

bug: CreateFlowLogs with S3 log destination fails to discover bucket #10773

Open
1 task done
viren-nadkarni opened this issue May 6, 2024 · 0 comments
Open
1 task done
Labels
aws:ec2 Amazon Elastic Compute Cloud status: backlog Triaged but not yet being worked on type: bug Bug report

Comments

@viren-nadkarni
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

EC2:CreateFlowLogs when used with the S3 log destination type fails with following error:

$ awslocal ec2 create-flow-logs --resource-ids vpc-b996311b --resource-type VPC --log-destination-type s3 --log-destination arn:aws:s3:::flowlogs 
{
    "FlowLogIds": [],
    "Unsuccessful": [
        {
            "Error": {
                "Code": "400",
                "Message": "LogDestination: flowlogs does not exist."
            },
            "ResourceId": "vpc-b996311b"
        }
    ]
}

This is despite the S3 bucket existing:

$ awslocal s3 ls
2024-05-06 19:27:15 flowlogs

Expected Behavior

No response

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

awslocal ec2 create-vpc --cidr-block 10.0.0.0/24 --query Vpc.VpcId --output text

awslocal s3 mb s3://flowlogs

awslocal ec2 create-flow-logs --resource-ids VPC --resource-type VPC --log-destination-type s3 --log-destination arn:aws:s3:::flowlogs 

Environment

- OS: jammy
- LocalStack: latest

Anything else?

This occurs because in the Moto implementation of CreateFlowLogs, the S3 backend is directly accessed.

https://github.com/getmoto/moto/blob/dea4a98b64fe8b8a8d7b02e5446756d1b439af55/moto/ec2/models/flow_logs.py#L225-L231

On the other hand, the bucket lives in the S3 provider in LocalStack and the Moto backend is empty really.

@viren-nadkarni viren-nadkarni added type: bug Bug report aws:ec2 Amazon Elastic Compute Cloud status: backlog Triaged but not yet being worked on labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:ec2 Amazon Elastic Compute Cloud status: backlog Triaged but not yet being worked on type: bug Bug report
Projects
None yet
Development

No branches or pull requests

1 participant