hallowed-animal-47023
09/06/2022, 7:53 PMable-thailand-87943
09/12/2022, 8:29 AMupdateInProgress
as a part of the output from pulumi stack ls --json
really shows "true", if there is a pulumi up running in the background when not using pulumi service backend? In the short tests we have run, we see that it always returns false
steep-lamp-20408
09/12/2022, 1:09 PMpulumilocal up
, I get this non explicit error:
Do you want to perform this update? yes
Updating (localstack)
View Live: <https://app.pulumi.com/my-user/myproject-backend/localstack/updates/5>
Type Name Status Info
pulumi:pulumi:Stack myproject-backend-localstack **failed** 1 error; 2 warnings
+ └─ aws:appsync:GraphQLApi myproject-localstack-graphqlapi **creating failed** 1 error
Diagnostics:
aws:appsync:GraphQLApi (myproject-localstack-graphqlapi):
error: 1 error occurred:
* error creating AppSync GraphQL API: InternalFailure:
status code: 501, request id: 2DNPS6TTA6YNSW2F783MVI1V6DJZEJ8GJ61G1F4F
pulumi:pulumi:Stack (myproject-backend-localstack):
warning: provider config warning: Use s3_use_path_style instead.
warning: provider config warning: Use s3_use_path_style instead.
error: update failed
Notes:
• The stack works well when pulumi up
on non-local.
• The stack consists of AWS resources, including a Appsync GraphQL API
• Side question: what are those warnings?kind-jelly-61624
09/13/2022, 8:56 PMfresh-scientist-11672
09/14/2022, 8:35 PM$ pip freeze | grep pulumi
pulumi==2.19.0
pulumi-gcp==4.12.0
quaint-tailor-52411
09/15/2022, 8:50 PMself.register_outputs()
actually do? when I register some child resources there and then later try to access them as a property of component object i get object no attribute my_outputted_resource
quaint-tailor-52411
09/15/2022, 8:51 PMbland-thailand-60821
09/15/2022, 10:14 PMimport pulumi
import pulumi_equinix_metal as equinix_metal
test = equinix_metal.Connection("test",
organization_id=local["my_organization_id"],
project_id=local["my_project_id"],
metro="sv",
redundancy="redundant",
type="shared")
__ERROR-----------------------
Diagnostics:
pulumi:pulumi:Stack (mosk-auto-test):
error: Program failed with an unhandled exception:
Traceback (most recent call last):
File "./__main__.py", line 4, in <module>
test = equinix_metal.Connection("test",
AttributeError: module 'pulumi_equinix_metal' has no attribute 'Connection'
limited-continent-1382
09/16/2022, 9:19 AMpulumi.export("ip", "0.0.0.0")
, but is there a way to get that exported value from that key using Python?breezy-knife-24305
09/20/2022, 6:49 PMpulumi_aws
) so that we can dynamically define configuration templates. I'm running into the following issue:
Traceback (most recent call last):
File "~/Documents/workspace/ops/pulumi/pulumi-config.py", line 17, in <module>
import pulumi_aws as aws
File "~/.virtualenvs/pulumi/lib/python3.9/site-packages/pulumi_aws/__init__.py", line 5, in <module>
from . import _utilities
File "~/.virtualenvs/pulumi/lib/python3.9/site-packages/pulumi_aws/_utilities.py", line 15, in <module>
import pulumi.runtime
ModuleNotFoundError: No module named 'pulumi.runtime'; 'pulumi' is not a package
Any ideas on how I can get pulumi.runtime
recognized?limited-continent-1382
09/21/2022, 10:04 AMfuture-france-34957
09/21/2022, 6:36 PM~ hosted_zones: [
~ [0]: {
arn : "arn:aws:route53:::hostedzone/Z06813069DDF4BVP5B49"
comment : "Hosted Zone for <http://env.example.com|env.example.com>"
force_destroy : false
id : "Z06813069DDF4BVP5B49"
name : "<http://env.example.com|env.example.com>"
name_servers : [
[0]: "<http://ns-1074.awsdns-09.org|ns-1074.awsdns-09.org>"
[1]: "<http://ns-1944.awsdns-52.co.uk|ns-1944.awsdns-52.co.uk>"
[2]: "<http://ns-475.awsdns-53.com|ns-475.awsdns-53.com>"
[3]: "<http://ns-948.awsdns-52.net|ns-948.awsdns-52.net>"
]
tags_all : {
provisioner: "pulumi"
}
urn : "urn:pulumi:all::shared::aws:route53/zone:Zone::<http://env.example.com|env.example.com>"
zone_id : "Z06813069DDF4BVP5B49"
}
~ [1]: {
arn : "arn:aws:route53:::hostedzone/Z05663573HLFBZ66YBFM2"
comment : "Hosted Zone for env.example.link"
force_destroy : false
id : "Z05663573HLFBZ66YBFM2"
name : "env.example.link"
name_servers : [
[0]: "<http://ns-1311.awsdns-33.org|ns-1311.awsdns-33.org>"
[1]: "<http://ns-1733.awsdns-22.co.uk|ns-1733.awsdns-22.co.uk>"
[2]: "<http://ns-191.awsdns-21.com|ns-191.awsdns-21.com>"
[3]: "<http://ns-786.awsdns-36.net|ns-786.awsdns-36.net>"
]
tags_all : {
provisioner: "pulumi"
}
urn : "urn:pulumi:all::shared::aws:route53/zone:Zone::env.example.link"
zone_id : "Z05663573HLFBZ66YBFM2"
}
]
I want to get, for example, the zone_id
where name
= <http://env.example.com|env.example.com>
My thought was to search the array for the index, for example, where name
= <http://env.example.com|env.example.com>
, in this case [0]
and then get the the value of zone_id
at that index (similar to this https://stackoverflow.com/a/19868472)
However, since this is a Pulumi Output object, I can’t iterate it like that:
TypeError: 'Output' object is not iterable, consider iterating the underlying value inside an 'apply'
So I attempted to first convert the object to json, using a render function (which has worked for me when needing a Pulumi Output object as a string, like this https://stackoverflow.com/a/73558276/18101704) but that doesn’t work either:
def get_shared_hosted_zones_to_string(shared_hosted_zones):
return json.dumps(shared_hosted_zones)
def get_zone_index(shared_hosted_zones_string, name):
return next(index for index, element in enumerate(shared_hosted_zones_string)
if element["name"] == name)
# For each domain, create Hosted Zone
# i.e. (<http://uat.env.example.com|uat.env.example.com>, uat.env.example.link)
for domain, name in domains.items():
hosted_zone = route53.Zone(
resource_name=f"{env_stack}.{domain_prefix}.{name}",
name=f"{env_stack}.{domain_prefix}.{name}",
comment=f"Hosted Zone for {env_stack}.{domain_prefix}.{name}",
tags=TAGS,
opts=ResourceOptions(protect=True)
)
shared_hosted_zones_string = Output.all(shared_hosted_zones).apply(
lambda shared_hosted_zones: get_shared_hosted_zones_to_string(shared_hosted_zones))
# select the hosted zone id where shared_hosted_zones.[].name == domain name
# i.e. which object in the hosted_zones array has name : "<http://env.example.com|env.example.com>",
# because need to get that zone_id
shared_hosted_zone = shared_hosted_zones_string[get_zone_index(
shared_hosted_zones_string, domain_prefix + name)]
shared_hosted_zones_string
is of type Output though. I don’t fully understand how this works here, but not in this case?
Any ideas?steep-lamp-20408
09/21/2022, 11:32 PM__main__.py
working fine, executed with pulumi up
CLI command.
In that script I need to use the Python toml
module, so I installed it the project dependencies and venv. Now, when I do pulumi up
, I get the error:
import toml
ModuleNotFoundError: No module named 'toml'
(needless to say everything is done in a venv where I double checked that toml
was actually installed, with pip list
).
It would seem that it’s not supported by Pulumi to use third-party Python modules in a Pulumi script? Or did I miss something?alert-monitor-28534
09/22/2022, 6:23 AM- address: Calling __str__ on an Output[T] is not supported.
To get the value of an Output[T] as an Output[str] consider:
1. o.apply(lambda v: f"prefix{v}suffix")
See <https://pulumi.io/help/outputs> for more details.
This function may throw in a future version of Pulumi.
This is what I've tried to do: vm1_public_ip_str = vm1.public_ip.apply(lambda public_ip: f"{public_ip}")
And this is how the cluster YAML should be generated:
output = cluster_template.render(
user="ubuntu",
master_public_ip=vm1_public_ip_str,
master_int_ip=vm1_private_ip_str,
worker_public_ip=vm2_public_ip_str,
worker_int_ip=vm2_private_ip_str,
ssh_key_path=ssh_key_path,
)
What to try next? Thanks in advance for the help!stocky-father-68249
09/24/2022, 9:03 AMmammoth-camera-90962
09/27/2022, 11:54 PMpulumi.error
, pulumi.warn
etc) for a dynamic resource appear attached to the dynamic resource in the console output? Calling pulumi.error(msg, self)
doesn't work.brash-restaurant-84207
09/28/2022, 11:36 AMsteep-lamp-20408
09/29/2022, 10:07 AMimport pulumi_aws as aws
iam_role = aws.iam.Role(
"my-role",
name="my-role",
assume_role_policy="""{
...
}
""",
inline_policies=[
aws.iam.RoleInlinePolicyArgs(
name=f"my-policy-{stack_name}",
policy=f"""{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:BatchGetItem",
"dynamodb:GetItem",
"dynamodb:Query",
"dynamodb:Scan",
],
"Resource": "arn:aws:dynamodb:ap-northeast-1:123456:table/myTablesPrefix-{stack_name}-*"
}
]
}
"""
),
],
)
...but I get the following error:
SyntaxError: f-string: expressions nested too deeply
However, it does not look like I’m trying to do nested string interpolation: I’m just doing string interpolation in a triple quoted string. Right?
So maybe it’s Pulumi is doing some string interpolation on top of it?
Any idea on how to solve that?quick-wolf-8403
09/29/2022, 6:03 PMrequirements.txt
file.
A workflow like this runs: https://github.com/pulumi/actions/blob/master/examples/python-pulumi.yaml
But I would like to do something like this:
- id: "setup-python-pulumi"
name: "Install Pulumi Python environment"
uses: actions/setup-python@v3
with:
python-version: '3.10'
- id: "get-deployment-deps"
name: "Get deployment script deps"
working-directory: iac
run: |
pipx install poetry
poetry install
- id: 'pulumi-deploy'
name: 'Deploy from Pulumi IaC'
uses: pulumi/actions@v3
with:
command: up
stack-name: nocap/dev
work-dir: iac
refresh: true
However, the Pulumi action fails, saying it can't import pulumi. It doesn't use the environment Poetry created.
Is there a way to specify your environment to the action?kind-jelly-61624
10/03/2022, 12:56 AMUnexpected <class 'NotImplementedError'>: Method not implemented!
I’m trying to make a top level function that is not dependent on a resourcekind-jelly-61624
10/03/2022, 6:10 PMbillions-journalist-44569
10/04/2022, 1:39 PMpulumi state delete <urn>
programmatically in Python or via REST API?shy-bird-55689
10/04/2022, 4:27 PMcreamy-window-21036
10/04/2022, 4:50 PMimport pulumi
import pulumi_aws as aws
import pulumi_eks as eks
role1 = aws.iam.Role("ways to retrieve it if it is already present in aws")
role2 = aws.iam.Role("ways to retrieve it if it is already present in aws")
cluster = eks.Cluster(...,instance_roles=[role1, role2],...)
I tried to
1. aws.iam.Role.get()
2. aws.iam.getRole()
3. aws.iam.Role("some_role", opt=pulumi.ResourceOption(import_="some_role"))
But nothing worked for me
Thanks in advance 🙂helpful-baker-38839
10/04/2022, 9:32 PMbucket = aws.s3.BucketV2.get("bucket", "bucket")
so I can then look at the bucket
object interactively?shy-bird-55689
10/05/2022, 1:47 PMerror: could not validate provider configuration: 1 error occurred:
* Invalid or unknown key
Not sure what this is referring to, this project has been working ok on a dev stack. This is now trying to deploy into my prod stack (for the first time)full-analyst-32960
10/05/2022, 5:28 PMaws.iam.Policy("policy",
description="Description",
policy = json.dumps({ ... })
)
AWS shows this as a “Customer managed” “Permission policy” but the name is “policy-8964f2d”. Pulumi add the stuff after the dash? Is there a way to prevent that? Is the info random or does it represent something?full-analyst-32960
10/06/2022, 1:28 AMfull-analyst-32960
10/06/2022, 1:35 AMrhythmic-branch-12845
10/06/2022, 3:10 PMrhythmic-branch-12845
10/06/2022, 3:10 PM