dazzling-answer-16144
07/13/2022, 12:43 AMaws.ec2.get_subnets()
into the arguments of aws.ec2.get_subnet()
as the former returns an awaitable which is not accepted by the latter, am I missing anything? Sample (broken code):
subnet_ids = await aws.ec2.get_subnets(
filters=[
aws.ec2.GetSubnetsFilterArgs(
name="vpc-id",
values=[vpc_id],
)
]
)
subnet = aws.ec2.get_subnet(id=subnet_ids[0])
rhythmic-branch-12845
07/13/2022, 9:50 AMimport
?rhythmic-branch-12845
07/13/2022, 12:01 PMquick-wolf-8403
07/15/2022, 10:44 PMkind-jelly-61624
07/18/2022, 5:59 PM{
acceleration_status : [secret]
bucket : {
acceleration_status : "Suspended"
acl : "private"
.......
}
}
When I return the encrypted acceleration_status as it’s own output - it stays encrypted. But when I return it as a field within the bucket object - it gets decrypted.quiet-plastic-34312
07/21/2022, 9:01 PMnutritious-battery-42762
07/22/2022, 6:18 PMpulumi-python:dynamic:Resource (godaddy-record):
error: Exception calling application: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
I found this issue but i still get the error even if the dynamic resource is defined inside __main__
https://github.com/pulumi/pulumi/issues/7453bored-vase-40478
07/25/2022, 6:48 PMfor subnet_id in private_subnets:
subnet = ec2.get_subnet(id=subnet_id)
az = subnet.availability_zone
### ENI
eni_name=...
eni=ec2.NetworkInterface(
resource_name=eni_name,
subnet_id=subnet_id,
...
)
my_ip=eni.private_ip.apply(lambda private_ip: f"my-{private_ip}")
print(my_ip)
bored-vase-40478
07/25/2022, 6:48 PMCalling __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.
straight-restaurant-537
07/27/2022, 3:24 AM@pulumi.runtime.test
def test_policy_assignment_created(self):
available_assignments = AvailableAssignments(assignments_json=self.object_mother.get_assignments_json())
sut = PolicyAssignmentComponent(self.policy_assignments_model, available_assignments, self.opts)
def check_policy_assignment(args):
management_group_name, policy_assignment_objects = args
assert management_group_name == self.policy_assignments_model.management_group_name
assert len(policy_assignment_objects) == self.object_mother.get_assignments_json_count()
def assert_policy_properties(args):
id, enforcement_mode, location, policy_definition_id = args
expected_policy_assignment = self.object_mother.get_policy_assignment_by_policy_def_id(
policy_def_id=policy_definition_id
)
expected_id = f"{management_group_name}-{expected_policy_assignment.name}_id"
assert expected_id == id
assert enforcement_mode == expected_policy_assignment.enforcementMode
assert location == expected_policy_assignment.location
assert policy_definition_id == expected_policy_assignment.policy_definition_id
for policy_assignment_object in policy_assignment_objects:
pulumi.Output.all(
policy_assignment_object.id,
policy_assignment_object.enforcement_mode,
policy_assignment_object.location,
policy_assignment_object.policy_definition_id,
).apply(assert_policy_properties)
return pulumi.Output.all(sut.management_group_name, sut.policy_assignment_objects).apply(check_policy_assignment)
white-terabyte-21934
07/27/2022, 9:36 AMkind-france-51068
07/27/2022, 8:12 PMshy-bird-55689
07/28/2022, 12:28 AMfull-window-21515
07/28/2022, 9:48 PMbusy-branch-95201
08/02/2022, 9:57 AMworried-gold-55244
08/04/2022, 7:42 PMtry:
key_pair = compute.get_keypair_output(args.region + '_key',
opts=pulumi.ResourceOptions(provider=provider, parent=self))
except:
key_pair = compute.Keypair(args.region + '_key',
name=args.region + '_key',
public_key=args.ssh_key_pub,
opts=pulumi.ResourceOptions(provider=provider, parent=self))
and error:
error: Program failed with an unhandled exception:
error: Traceback (most recent call last):
File "/usr/local/bin/pulumi-language-python-exec", line 107, in <module>
loop.run_until_complete(coro)
File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/Users/amuntean/Projects/new_netlog/venv/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
await run_pulumi_func(lambda: Stack(func))
File "/Users/amuntean/Projects/new_netlog/venv/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
await wait_for_rpcs()
File "/Users/amuntean/Projects/new_netlog/venv/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 110, in wait_for_rpcs
raise exception
File "/Users/amuntean/Projects/new_netlog/venv/lib/python3.9/site-packages/pulumi/output.py", line 194, in run
transformed: Input[U] = func(value)
File "/Users/amuntean/Projects/new_netlog/venv/lib/python3.9/site-packages/pulumi_openstack/_utilities.py", line 232, in <lambda>
}).apply(lambda resolved_args: func(*resolved_args['args'],
File "/Users/amuntean/Projects/new_netlog/venv/lib/python3.9/site-packages/pulumi_openstack/compute/get_keypair.py", line 121, in get_keypair
__ret__ = pulumi.runtime.invoke('openstack:compute/getKeypair:getKeypair', __args__, opts=opts, typ=GetKeypairResult).value
File "/Users/amuntean/Projects/new_netlog/venv/lib/python3.9/site-packages/pulumi/runtime/invoke.py", line 144, in invoke
raise invoke_error
Exception: invoke of openstack:compute/getKeypair:getKeypair failed: invocation of openstack:compute/getKeypair:getKeypair returned an error: invoking openstack:compute/getKeypair:getKeypair: 1 error occurred:
* Error retrieving openstack_compute_keypair_v2 iad-private-dev_key: Resource not found
error: an unhandled error occurred: Program exited with non-zero exit code: 1
kind-hamburger-15227
08/05/2022, 12:17 AMimport pulumi
import pulumi_aws as aws
# Create an AWS provider for the us-east-1 region.
useast1 = aws.Provider("useast1", region="us-east-1")
# Create an ACM certificate in us-east-1.
cert = aws.acm.Certificate("cert",
domain_name="<http://foo.com|foo.com>",
validation_method="EMAIL",
__opts__=pulumi.ResourceOptions(provider=useast1))
Trying to create my own provider, but it fails with
File ~/.local/lib/python3.10/site-packages/pulumi/runtime/settings.py:202, in get_monitor()
200 monitor = SETTINGS.monitor
201 if not monitor:
--> 202 require_test_mode_enabled()
203 return monitor
File ~/.local/lib/python3.10/site-packages/pulumi/runtime/settings.py:147, in require_test_mode_enabled()
145 def require_test_mode_enabled():
146 if not is_test_mode_enabled():
--> 147 raise RunError(
148 "Program run without the Pulumi engine available; re-run using the `pulumi` CLI"
149 )
RunError: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
The purpose of the provide to set config pulumi config set aws:skipCredentialsValidation true
- I am trying to run flask api example for automation api: https://github.com/pulumi/automation-api-examples/blob/main/python/pulumi_over_http/app.py any hints? Original sample fails with
Diagnostics:
aws:s3:Bucket (s3-website-bucket):
error: 1 error occurred:
* error configuring Terraform AWS Provider: AWS account ID not previously found and failed retrieving via all available methods. See <https://www.terraform.io/docs/providers/aws/index.html#skip_requesting_account_id> for workaround and implications. Errors: 2 errors occurred:
kind-hamburger-15227
08/07/2022, 11:02 AMlistener = awsx.lb.NetworkLoadBalancer("lb",default_target_group=['group',{ 'port' : 80, 'protocol':'TCP'}])
I am trying to re-create typescript example in python
const listener = new awsx.lb.NetworkLoadBalancer('lb')
.createTargetGroup('group', { port: 80, protocol: 'TCP' })
.createListener('listener', {
port: 443,
protocol: 'TLS',
// ARN of the Amazon Cert Manager certificate for *.<http://mysite.com|mysite.com>
certificateArn: certCertificate.arn,
})
few-tent-80031
08/08/2022, 4:02 PMdatabase = aws.rds.Instance(
resource_name="master-thesis-rds",
allocated_storage = 5,
instance_class='db.t4g.micro',
allow_major_version_upgrade=False,
apply_immediately=False,
auto_minor_version_upgrade=True,
db_name='master',
db_subnet_group_name='db-subnet-group',
deletion_protection=False,
enabled_cloudwatch_logs_exports=['audit', 'error', 'general', 'slowquery'],
engine='mysql',
performance_insights_enabled=True,
port=5432,
publicly_accessible=False,
skip_final_snapshot=True,
vpc_security_group_ids=[db_sg.id],
username='',
password=password.value
)
Then, I did this:
rds_endpoint = database.address.apply(lambda address: f"http://{address}")
And last, I have ecs container definition with these env vars:
"environment": [
{
"name": "user", "value": ""
},
{
"name": "password", "value": f"{password.value}"
},
{
"name": "db_host_replica", "value": rds_endpoint
},
{
"name": "db_host", "value": rds_endpoint
}
],
However, when I run this, I get
TypeError: Object of type Output is not JSON serializable
Do you guys know where is a mistake? I tried different ways but I cannot get right output converted to string. Thank yousparse-intern-71089
08/09/2022, 7:55 AMprehistoric-book-85014
08/18/2022, 9:21 PMelegant-smartphone-60282
08/21/2022, 12:27 PMerror: Program failed with an unhandled exception:
Traceback (most recent call last):
File "/opt/homebrew/bin/pulumi-language-python-exec", line 111, in <module>
loop.run_until_complete(coro)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
return future.result()
File "/Users/afeefaz/Downloads/iac/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
await run_pulumi_func(lambda: Stack(func))
File "/Users/afeefaz/Downloads/iac/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
await wait_for_rpcs()
File "/Users/afeefaz/Downloads/iac/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 73, in wait_for_rpcs
await RPC_MANAGER.rpcs.pop()
File "/Users/afeefaz/Downloads/iac/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/rpc_manager.py", line 68, in rpc_wrapper
result = await rpc
File "/Users/afeefaz/Downloads/iac/pulumi/venv/lib/python3.10/site-packages/pulumi/output.py", line 98, in is_value_known
return await is_known and not contains_unknowns(await future)
File "/Users/afeefaz/Downloads/iac/pulumi/venv/lib/python3.10/site-packages/pulumi/output.py", line 98, in is_value_known
return await is_known and not contains_unknowns(await future)
File "/Users/afeefaz/Downloads/iac/pulumi/venv/lib/python3.10/site-packages/pulumi/output.py", line 98, in is_value_known
return await is_known and not contains_unknowns(await future)
[Previous line repeated 10 more times]
File "/Users/afeefaz/Downloads/iac/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/resource.py", line 561, in do_register
req = resource_pb2.RegisterResourceRequest(
TypeError: bad argument type for built-in operation
Here’s the python code :
# check for SG existence
try:
existing_sg = aws.ec2.get_security_group(name="sg_name", vpc_id=vpc_id)
except:
print("Creating new SG")
created_sg = aws.ec2.SecurityGroup("sg_name",
name="sg_name",
vpc_id=vpc_id,
egress=[{
'from_port': 0,
'to_port': 0,
'protocol': "-1",
'cidr_blocks': ['0.0.0.0/0']
}],
ingress=[{
'from_port': 0,
'to_port': 0,
'protocol': "-1",
'cidr_blocks': ['0.0.0.0/0']
}],
tags={
"Name":"sg_name"
}
)
pulumi.export("sg_name", created_sg.id)
else:
aws.ec2.SecurityGroup("sg_name",
opts=pulumi.ResourceOptions(
import_=[existing_sg.id]
)
)
elegant-smartphone-60282
08/25/2022, 12:07 PMpublic_subnets = dis_stack.get_output("public_subnets")
subnets_list = public_subnets.apply(lambda id: id)
but it returns an output object, how can i do that i get a list ?aloof-traffic-97122
08/25/2022, 6:01 PMelegant-smartphone-60282
08/30/2022, 8:24 AMparent_dir:
file_1.py
folder_1:
folder_2:
file_2.py
i want to import file_1 to file_2, how to do that?nutritious-battery-42762
09/01/2022, 5:33 PMaws-native:ecs:TaskDefinition app-task-definition-staging updating [diff: ~containerDefinitions]; error: operation error CloudControl: UpdateResource, https response error StatusCode: 400, RequestID: c85809ba-1dc5-44ca-be06-ab16f348a1fb, NotUpdatableException: Invalid patch update: createOnlyProperties [/properties/ContainerDefinitions] cannot be updated
~ aws-native:ecs:TaskDefinition app-task-definition-staging **updating failed** [diff: ~containerDefinitions]; error: operation error CloudControl: UpdateResource, https response error StatusCode: 400, RequestID: c85809ba-1dc5-44ca-be06-ab16f348a1fb, NotUpdatableException: Invalid patch update: createOnlyProperties [/properties/ContainerDefinitions] cannot be updated
pulumi:pulumi:Stack frontent-frontend.staging running error: update failed
glamo:resource:Service frontend-service
pulumi:pulumi:Stack frontent-frontend.staging **failed** 1 error
worried-xylophone-86184
09/01/2022, 6:19 PMvictorious-continent-984
09/04/2022, 12:52 PMwarning: Error downloading plugin: 403 HTTP error fetching plugin from <https://get.pulumi.com/releases/plugins/>...
I’m using several custom python packages generated using crd2pulumi. It seems like plugin resolving mechanism tries to download something from public repo…
This is very annoying since int adds a good few minutes for each pulumi up run. Do you know anything about it?astonishing-branch-30086
09/06/2022, 9:43 AMoutputs
in the resource's stack entry.
How do I solve this cleanly? I'm guessing the correct way is to somehow update the state only, so that for the dynamic resource, the outputs are rewritten with the current inputs?astonishing-branch-30086
09/06/2022, 9:44 AMpulumi refresh
do this? Admittedly, we were lazy and have skipped the implementation of refresh() for the resource.astonishing-branch-30086
09/06/2022, 9:44 AMpulumi refresh
do this? Admittedly, we were lazy and have skipped the implementation of refresh() for the resource.