Hello all, How can I get properties of a Repositor...
# python
p
Hello all, How can I get properties of a Repository? When I use: ruri=repo.get(resource_name=reponame, id=repoid) The result is: ruri     : {    + arn             : “arnawsecrus east 1xxxx*:repository/my-repo*”    + encryption_configurations  : [    +   [0]: {        + encryption_type: “AES256"       }     ]    + id             : “my-repox”    + image_scanning_configuration: {      + scan_on_push: false     }    + image_tag_mutability    : “MUTABLE”    + name            : “my-repo”    + registry_id         : “xxxxxx”    + repository_url       : “xxxxx.dkr.ecr.us-east-1.amazonaws.com/my-repo-xxxxx”    + urn             : “urnpulumidev:gurney pythonawsecr/repositoryRepository:my-repo” Then I used ruri.apply(lambda r: r[“repository_url”]) but I got this message: TypeError: ‘Repository’ object is not subscriptable So, how should I get the repository_url ?
p
I’m not sure what kind of resource it is but have you tried
r.repository_url
?
Most (all?) properties of pulumi resources are accessed like fields in the class object (
obj.property_name
) and they are not subscriptable (= they do not behave like dict so
obj["property_name"]
won’t work)
s
p
Thank you @prehistoric-activity-61023. Yes, your suggestion works. Actually with that there is no need for using “apply”. I can get it with ruri.repository_url directly.