https://pulumi.com logo
#aws
Title
# aws
a

alert-raincoat-81485

11/20/2020, 6:55 AM
Hello folks, When i am trying to create Ingress/Egress attribute of the SecurityGroup, it throws a following error
Copy code
ingress=[aws.ec2.SecurityGroupIngressArgs(
    AttributeError: module 'pulumi_aws.ec2' has no attribute 'SecurityGroupIngressArgs'
The code was referred from an Pulumi docs example.
Copy code
security_group = aws.ec2.SecurityGroup( # type: ignore
    "secgrp",
    description="Splunk Hybrid cloud security group",
    vpc_id=vpcid,
    ingress=[aws.ec2.SecurityGroupIngressArgs(
        description="TLS from VPC",
        from_port=443,
        to_port=443,
        protocol="tcp",
        cidr_blocks=["0.0.0.0/0"],
    )],
    egress=[aws.ec2.SecurityGroupEgressArgs(
        from_port=0,
        to_port=0,
        protocol="-1",
        cidr_blocks=["0.0.0.0/0"],
    )],
)
Any suggestions?
w

witty-candle-66007

11/20/2020, 2:23 PM
I don’t have a real answer for you. But I copied your security group declaration and was able to
pulumi up
without the error. So it seems it may be related to your environment?
1
b

broad-dog-22463

11/20/2020, 3:56 PM
@alert-raincoat-81485 I would suggest it's down to the version of pulumi-aws you are using
1
a

alert-raincoat-81485

11/20/2020, 5:54 PM
@witty-candle-66007 I would try that again. Thank you Mitch
@broad-dog-22463 Which pulumi version should i run to? The current version. i am running is 2.12.1 I saw the warning while running pulumi
A new version of Pulumi is available. To upgrade from version '2.12.1' to '2.14.0'
b

broad-dog-22463

11/20/2020, 5:56 PM
Pulumi-aws package is the potential issue here - what version are you running?
I’m betting it’s Pulumi-aws <3.2
a

alert-raincoat-81485

11/20/2020, 5:59 PM
The current version of pulumi-aws :3.13.0
b

broad-dog-22463

11/20/2020, 6:05 PM
Then there is bug for sure
Unless you’ve updated the requirements.txt and not actually ran a pip install to get the new packages
a

alert-raincoat-81485

11/20/2020, 6:19 PM
I have installed all requirements as well. But still let me follow up and try installing again from scratch.
2 Views