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

efs: cant set allow_anonymous_access #30929

Closed
Zujiry opened this issue Jul 23, 2024 · 7 comments
Closed

efs: cant set allow_anonymous_access #30929

Zujiry opened this issue Jul 23, 2024 · 7 comments
Labels
@aws-cdk/aws-efs Related to Amazon Elastic File System bug This issue is a bug. p3

Comments

@Zujiry
Copy link

Zujiry commented Jul 23, 2024

Describe the bug

Setting the allow_anonymous_access to True like:

        self.s3_mirror_fs = efs.FileSystem(
            self,
            id="test_efs",
            file_system_name="test_efs",
            vpc=vpc,
            lifecycle_policy=efs.LifecyclePolicy.AFTER_90_DAYS,
            removal_policy=RemovalPolicy.DESTROY,
           allow_anonymous_access=True
        )

Throws the error:

TypeError: FileSystem.init() got an unexpected keyword argument 'allow_anonymous_access'
Subprocess exited with error 1

Expected Behavior

It should be possbile to set allow_anonymous_access in FileSystem creation

Current Behavior

Its not possible to set allow_anonymous_access

Reproduction Steps

Deploy an efs.FileSystem with allow_anonymous_access.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.150.0

Framework Version

No response

Node.js Version

18

OS

WSL2

Language

Python

Language Version

3.12

Other information

No response

@Zujiry Zujiry added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 23, 2024
@github-actions github-actions bot added the @aws-cdk/aws-efs Related to Amazon Elastic File System label Jul 23, 2024
@pahud
Copy link
Contributor

pahud commented Jul 23, 2024

It should work.

class DummyStack(Stack):
    def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id, **kwargs)
        
        vpc = ec2.Vpc.from_lookup(self, 'Vpc', is_default=True)
        efs.FileSystem(
          self,
          id="test_efs",
          file_system_name="test_efs",
          vpc=vpc,
          lifecycle_policy=efs.LifecyclePolicy.AFTER_90_DAYS,
          removal_policy=RemovalPolicy.DESTROY,
          allow_anonymous_access=True
        )

cdk diff

Resources
[+] AWS::EFS::FileSystem test_efs testefsF6A4FC38 
[+] AWS::EC2::SecurityGroup test_efs/EfsSecurityGroup testefsEfsSecurityGroup8B3DA35F 
[+] AWS::EFS::MountTarget test_efs/EfsMountTarget1 testefsEfsMountTarget1A208FA23 
[+] AWS::EFS::MountTarget test_efs/EfsMountTarget2 testefsEfsMountTarget296A5B6F1 
[+] AWS::EFS::MountTarget test_efs/EfsMountTarget3 testefsEfsMountTarget3270BAE38 

% cdk --version
2.150.0 (build 3f93027)
% grep aws-cdk-lib requirements.txt
aws-cdk-lib==2.150.0

Can you try again with a new directory and make sure the cdk version is up to date?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p3 and removed needs-triage This issue or PR still needs to be triaged. labels Jul 23, 2024
@Zujiry
Copy link
Author

Zujiry commented Jul 23, 2024

New folder created but still have the same problem:

Traceback (most recent call last):
  File "/home/user/repos/repo/testefs/app.py", line 10, in <module>
    TestefsStack(app, "TestefsStack",
  File "/home/user/repos/repo/.venv/lib/python3.10/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
  File "/home/user/repos/repo/testefs/testefs/testefs_stack.py", line 15, in __init__
    efs.FileSystem(
  File "/home/user/repos/repo/.venv/lib/python3.10/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
TypeError: FileSystem.__init__() got an unexpected keyword argument 'allow_anonymous_access'

requirements.txt:

aws-cdk-lib==2.150.0
constructs>=10.0.0,<11.0.0

% cdk --version
2.150.0 (build 3f93027)

tried with python 3.10 and 3.12

@Zujiry
Copy link
Author

Zujiry commented Jul 23, 2024

Maybe this helps?

% npm --version
10.8.2
% nodejs -v
v18.20.4

@pahud
Copy link
Contributor

pahud commented Jul 23, 2024

Make sure you have activated the venv

$ source .venv/bin/activate
$ pip install -r requirements.txt
$ cdk diff

Let me know if it works for you.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 23, 2024
@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 23, 2024
@Zujiry
Copy link
Author

Zujiry commented Jul 23, 2024

It wasnt the not activated venv, but another venv in which it was installed... thanks!

@Zujiry Zujiry closed this as completed Jul 23, 2024
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
@kellertk kellertk removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-efs Related to Amazon Elastic File System bug This issue is a bug. p3
Projects
None yet
Development

No branches or pull requests

5 participants