high-cartoon-83388
07/09/2021, 10:44 AMpulumi up
pulumi destroy
or pulumi preview
?
Something like pulumi.runtime.command
perhaps ?great-sunset-355
07/12/2021, 8:02 AMregister_outputs
should work with secrets opts=ResourceOptions(additional_secret_outputs=['password'])
The result of the code above is this for both the First
and the Second
component.
I'm probably doing something wrong that the password
is not marked as a secret value in resource outputs.
here is the result of pulumi stack export
{
"version": 3,
"resources": [
{
"urn": "urn:pulumi:dev::tests::pulumi:pulumi:Stack::tests-dev",
"custom": false,
"type": "pulumi:pulumi:Stack"
},
{
"urn": "urn:pulumi:dev::tests::custom:first::first",
"custom": false,
"type": "custom:first",
"outputs": {
"password": "222222",
"w2": "222222"
},
"parent": "urn:pulumi:dev::tests::pulumi:pulumi:Stack::tests-dev",
"additionalSecretOutputs": [
"password"
]
},
{
"urn": "urn:pulumi:dev::tests::custom:second::second",
"custom": false,
"type": "custom:second",
"outputs": {
"password": "Secret"
},
"parent": "urn:pulumi:dev::tests::pulumi:pulumi:Stack::tests-dev",
"additionalSecretOutputs": [
"password"
]
}
]
}
}
astonishing-dinner-89046
07/12/2021, 3:47 PMdvo.domainName
as well as (name, record) parameters in the for range in
loop doesn’t seem to be working. Any ideas?witty-dentist-91954
07/13/2021, 4:40 PMmy_nodeport = my_svc.spec.apply(lambda p: p.ports[0]['node_port'])
But this failes with an KeyError: 'node_port'
in outputs.py. It works, if I first create the NodePort and create the firewall in a second run.
I would like to avoid setting a fixed node_port in the service. Is there a way to do that?broad-hairdresser-1495
07/15/2021, 2:54 PMDo you want to perform this update? [Use arrows to move, enter to select, type to filter]
yes
> no
details
Is there a Pulumi function that can retrieve user input when running pulumi up
?average-school-38756
07/15/2021, 11:33 PMaws.secretsmanager.Secret
and a corresponding SecretVersion
, but not have the value stored anywhere in state, not even encrypted - i just want Secrets Manager to keep track of the value. Is there a way to write this way?shy-author-33795
07/21/2021, 3:59 PMprovisioners.py
file without revision and I'm importing it in my __main__.py
with import provisioners
. I am using a dynamic provider to remote exec into a server with network access to an aurora cluster to run a MySQL command, show databases
. However, my program errors:
└─ pulumi-python:dynamic:Resource show-dbs 1 error
Diagnostics:
pulumi-python:dynamic:Resource (show-dbs):
error: Exception calling application: No module named 'provisioners'
I'm not sure what i'm doing wrong to make this module unavailable.aloof-jelly-80665
07/21/2021, 8:36 PMgoogle_beta
variable, but I can’t find an instantiation of it.great-alligator-26951
07/28/2021, 12:48 AM# define a function to write an arn to a file
def write_to_file(arn):
f = open("arn.txt", "a")
f.write(arn)
f.close()
json = lb.arn.apply(lambda a: write_to_file(arn=a))
great-sunset-355
07/29/2021, 7:28 AMCertificateDomainValidationOptionArgs
https://www.pulumi.com/docs/reference/pkg/aws/acm/certificate/#outputs
I'd like to be able to use it as cert_validation_option.domain_name
, etc...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 thiscrooked-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 thisfull-artist-27215
09/13/2021, 3:06 PMpolicy=pulumi.Output.all(*[t.arn for t in tables]).apply(
lambda arns: json.dumps(
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
# Read
"dynamodb:BatchGetItem",
"dynamodb:GetRecords",
"dynamodb:GetShardIterator",
"dynamodb:Query",
"dynamodb:GetItem",
"dynamodb:Scan",
# Write
"dynamodb:BatchWriteItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
],
"Resource": [a for a in arns],
}
],
}
)
),
[a for a in arns]
is a holdover from a prior refactoring... could probably just be arns
at this point 😅