little-journalist-4778
08/09/2021, 11:26 AM@pulumi.input_type
class RoleMappingArgs:
groups: pulumi.Input[Sequence[pulumi.Input[str]]] = pulumi.property("groups")
role_arn: pulumi.Input[str] = pulumi.property("role_arn")
username: pulumi.Input[str] = pulumi.property("username")
Or is this something I should use only for cross language components?
I can just declare nested args classes and the Outputs will be respected correctly?sparse-state-34229
08/11/2021, 8:00 PMpulumi up
on a stack that references other stacks, the stack reference is empty. in this case, it’s a reference to an AWS region. additionally, when they run pulumi config
the output is empty, where as when I run it on the same stack I do see the expected config outputworried-queen-62794
08/12/2021, 10:20 PMDiagnostics:
pulumi:pulumi:Stack (tlayen-prod):
error: missing executor /Users/jason/go/bin/pulumi-language-python-exec
error: failed to load language plugin python: could not read plugin [/Users/jason/go/bin/pulumi-language-python] stdout: EOF
It is the same error as https://github.com/pulumi/pulumi/issues/1956 but I don’t get how to fix it.
It was working fine until I upgraded pulumi via brew.cool-belgium-78445
08/16/2021, 2:57 PMclass AccountProvider(ResourceProvider):
def __init__(self, props):
self.parent_client = Client(props["sid"], props["auth_token"])
def create(self, props):
subaccount = self.parent_client.api.accounts.create(friendly_name="{}-{}".format(props["name"], stack))
return CreateResult(id_=subaccount.sid, outs={'sid':subaccount.sid, 'auth_token':subaccount.auth_token})
def delete(self, id, props):
self.parent_client.api.accounts(id).update(status="closed")
class Account(Resource):
sid: Output[str]
auth_token: Output[str]
def __init__(self, name: str, props, opts: Optional[ResourceOptions] = None):
super().__init__(AccountProvider(props), name, {"name":name, 'sid':None, 'auth_token':None}, opts)
new_account = Account("new_account1", props=AccountCredentials(sid=account_sid, auth_token=auth_token))
adamant-france-50503
08/17/2021, 10:16 PMgorgeous-minister-41131
08/19/2021, 8:56 PMProbeArgs(
http_get=HTTPGetActionArgs(
path="/healthz",
port=DEFAULT_SERVICE_PORTS_SPEC["http"]["port"],
scheme="HTTP",
),
failure_threshold=2,
initial_delay_seconds=60,
period_seconds=30,
success_threshold=1,
timeout_seconds=5,
),
is it acceptable practice to skip using the verbose class & arg and go straight to constructing things like this?
liveness_probe={"http_get": {"path": "/healthz", "port": DEFAULT_SERVICE_PORTS_SPEC["http"]["port"], "scheme": "http"}, "failure_threshold": 2, "initial_delay_sections": 60, "period_seconds": 30, "success_threshold": 1, "timeout_seconds": 5}
gorgeous-minister-41131
08/19/2021, 8:57 PMgorgeous-minister-41131
08/19/2021, 8:58 PMgorgeous-minister-41131
08/19/2021, 8:59 PMfreezing-van-87649
08/20/2021, 12:14 PMadorable-noon-15528
08/23/2021, 2:02 PMbest-nest-62071
08/24/2021, 6:43 PMAssertionError: Unexpected type. Expected 'list' got '<class 'pulumi_aws.ec2._inputs.InstanceRootBlockDeviceArgs'>'
error: an unhandled error occurred: Program exited with non-zero exit code: 1
In pulumi I cant figure out how to convert the class to a list, Or even if I should be doing that. Im sure there's a pulumi way of doing this. Please point me in the right direction.
Code:
for i in range(5):
server = aws.ec2.Instance(f"webserver-{i:03}",
ami=ami.id,
iam_instance_profile='ec2_role',
instance_type=size,
key_name=sshKey,
root_block_device=[aws.ec2.InstanceRootBlockDeviceArgs(
device_name='/dev/sda1',
volume_size=100,
volume_type='gp3',
)],
subnet_id=['subnet-xxxxxxxxxxxxxxxx'],
tags={
"Name": f"webserver-{i:03}",
"Purpose": "webapp"
},
volume_tags={
"Name": f"webserver-{i:03}",
"Purpose": "webapp"
},
vpc_security_group_ids=[ secgrp.id ]
)
https://www.pulumi.com/docs/reference/pkg/aws/ec2/instance/#instancerootblockdeviceglamorous-cpu-85849
08/25/2021, 10:01 AMalert-mechanic-59024
08/29/2021, 11:50 AMalert-lock-34522
08/30/2021, 4:58 PMbreezy-piano-61073
08/31/2021, 9:22 PMimport pulumi
import pulumi_newrelic as newrelic
foo_monitor = newrelic.synthetics.get_monitor(name="foo")
foo_alert_condition = newrelic.synthetics.AlertCondition("fooAlertCondition",
policy_id=newrelic_alert_policy["foo"]["id"],
monitor_id=foo_monitor.id,
runbook_url="<https://www.example.com>")
I was wondering what “newrelic_alert_policy” is. A function, variable? It isn’t defined in the example.
All I’m trying to do is create a simple alert for some simple synthetic monitors I’ve put together.enough-butcher-66045
09/01/2021, 6:22 AMconst webhook = pulumi.all([resourceGroup.name, webApp.name])
.apply(([resourceGroupName, name]) =>
web.listWebAppPublishingCredentials({ resourceGroupName, name }))
.apply(creds => creds.scmUri + "/docker/hook");
But when trying to run the same in python, it's basically saying "The web app resource was not found", which makes sense... because I'm trying to create it right before.
What would be the right way to solve this? One option is to create a different stack and have them run one after the other but that's something I'd really, really like to avoid.enough-butcher-66045
09/02/2021, 6:05 AMwebApp.id
in the output interpolation like pulumi.all([resourceGroup.name, webApp.name, webApp.id])
even if it's not used, so it's forced to waitcrooked-pillow-11944
09/13/2021, 1:33 AM+ subnets: [
+ [0]: "10.2.0.0/22"
+ [1]: "10.4.0.0/22"
+ [2]: "10.6.0.0/22"
+ [3]: "10.8.0.0/22"
+ [4]: "10.10.0.0/22"
+ [5]: "10.12.0.0/22"
+ [6]: "10.14.0.0/22"
]
I can set a value by using the index (i.e. ['subnets'][0]
)
I want to iterate over the subnets to create them but I can't use a for loop because 'Output' object is not iterable
How can I use these values in the output?crooked-pillow-11944
09/13/2021, 2:59 PMOutput.all
with a list?
The documentation says that you would use it's Output
with an .apply
but I'm uncertain of a practical application for thisalert-raincoat-81485
09/13/2021, 8:49 PMpulumi up
for the upgrades or refresh.
Previewing update (d2):
Type Name Plan Info
pulumi:pulumi:Stack roletest-d2 1 message
- ├─ aws:iam:RolePolicyAttachment <pulumi_aws.iam.get_policy.AwaitableGetPolicyResult object at 0x106fa1f70> delete
- ├─ aws:iam:RolePolicyAttachment <pulumi_aws.iam.get_policy.AwaitableGetPolicyResult object at 0x106fa1d00> delete
- ├─ aws:iam:RolePolicyAttachment <pulumi_aws.iam.policy.Policy object at 0x106fb7130> delete
- ├─ aws:iam:RolePolicyAttachment <pulumi_aws.iam.get_policy.AwaitableGetPolicyResult object at 0x106fb7040> delete
- ├─ aws:iam:Policy policy-as14 delete
- └─ aws:iam:Role roleas14 delete
Any suggestions?brainy-lion-38675
09/17/2021, 5:30 PMst_keys = pulumi.Output.all([rg.resource_group_name, st.name]).apply(
lambda rg_name, st_name: storage.list_storage_account_keys(
resource_group_name=rg_name,
account_name=st_name
)
)
which fails with
File "/Users/xxx/development/xxx-pulumi-azure/venv/lib/python3.9/site-packages/pulumi/output.py", line 181, in run
transformed: Input[U] = func(value)
TypeError: <lambda>() missing 1 required positional argument: 'st_name'
error: an unhandled error occurred: Program exited with non-zero exit code: 1
What am I doing wrong?gorgeous-minister-41131
09/21/2021, 7:03 PMgorgeous-minister-41131
09/21/2021, 7:07 PMvictorious-exabyte-70545
09/22/2021, 9:36 PMAttributeError: 'NoneType' object has no attribute '__name__'
In [27]: auto.select_stack("stackname", work_dir="/path_to_project")
victorious-exabyte-70545
09/22/2021, 9:36 PMvictorious-exabyte-70545
09/22/2021, 9:36 PM__main__.py
victorious-exabyte-70545
09/22/2021, 9:36 PMvictorious-exabyte-70545
09/22/2021, 9:36 PMvictorious-exabyte-70545
09/22/2021, 10:13 PMAttributeError Traceback (most recent call last)
~/virtuals/sourcescrub/lib/python3.9/site-packages/IPython/core/formatters.py in __call__(self, obj)
700 type_pprinters=self.type_printers,
701 deferred_pprinters=self.deferred_printers)
--> 702 printer.pretty(obj)
703 printer.flush()
704 return stream.getvalue()
~/virtuals/sourcescrub/lib/python3.9/site-packages/IPython/lib/pretty.py in pretty(self, obj)
392 if cls is not object \
393 and callable(cls.__dict__.get('__repr__')):
--> 394 return _repr_pprint(obj, self, cycle)
395
396 return _default_pprint(obj, self, cycle)
~/virtuals/sourcescrub/lib/python3.9/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)
698 """A pprint that just redirects to the normal repr function."""
699 # Find newlines and replace them with p.break_()
--> 700 output = repr(obj)
701 lines = output.splitlines()
702 with p.group():
~/virtuals/sourcescrub/lib/python3.9/site-packages/pulumi/automation/_stack.py in __repr__(self)
189
190 def __repr__(self):
--> 191 return f"Stack(stack_name={self.name!r}, workspace={self.workspace!r}, mode={self._mode!r})"
192
193 def __str__(self):
~/virtuals/sourcescrub/lib/python3.9/site-packages/pulumi/automation/_local_workspace.py in __repr__(self)
102
103 def __repr__(self):
--> 104 return f"{self.__class__.__name__}(work_dir={self.work_dir!r}, program={self.program.__name__}, " \
105 f"pulumi_home={self.pulumi_home!r}, env_vars={self.env_vars!r}, " \
106 f"secrets_provider={self.secrets_provider})"
AttributeError: 'NoneType' object has no attribute '__name__'