Hi, I’m using python and AWS cloud. Would I post m...
# general
a
Hi, I’m using python and AWS cloud. Would I post my question in #python or #aws?
l
Depends on the problem 🙂 If it's about the Python SDK, then #python If it's a problem with AWS resources and the AWS SDK, then #aws If it's Pulumi usage or you're just not sure, then #general.
a
Thank you, I figured I have 50/50. I’m not sure if it’s pulumi SDK or AWS … https://pulumi-community.slack.com/archives/CDE799L1M/p1716348321431119
l
In Python, are functions called attributes? If not, then this would be a #python issue, as you're using a function incorrectly. If they are, then this might be a #general issue, since there's a problem with an SDK. I don't think it's an #aws issue.
Unfortunately, you wouldn't know that unless you know the solution 🙂 So I think you've done the right thing.
a
Thank you. I don’t think a function is an attribute, but I’m not an everyday python user, so I’m not great with ‘terms’ . But I did follow the code references into the pulumi code and I do see that it’s a function, https://github.com/pulumi/pulumi-aws/blob/master/sdk/python/pulumi_aws/ecr/get_lifecycle_policy_document.py#L70
l
And in your code, are you calling it as a function? Is there a
(
immediately after
pulumi_aws.ecr.get_lifecycle_policy_document
?
a
yes here are the snips
Copy code
import pulumi_aws as aws
...
lifecycle_policy_doc = aws.ecr.get_lifecycle_policy_document(
            rules=[aws.ecr.GetLifecyclePolicyDocumentRuleArgs(
                priority=1,
                action=aws.ecr.GetLifecyclePolicyDocumentRuleActionArgs(
                    type="expire"
                ),
                selection=aws.ecr.GetLifecyclePolicyDocumentRuleSelectionArgs(
                    count_number=10,
                    count_type="imageCountMoreThan",
                    tag_status="tagged",
                    tag_prefix_list=["v"]
                )
            )
            ])
l
Looks ok to me. Maybe it's an indentation issue? (Like the rest of Python arf arf!)
I think the experts over in #python have the best chance to solve this one.
a
OK, well, thanks for taking a look!