lemon-intern-77136
10/21/2022, 7:51 PMd = {}
d['user'] = ['default'] + [aDictWithAnOutputInstance] + [anotherDictWithOutputInstances]
d['other_stuff'] = ...
d['more_things'] = {'more_things_1': againAnOutputInstance, 'more_things_2': 'regular string'}
y = yaml.dump(d, Dumper=yaml.Dumper)
Any ideas how to make this work? The .apply
and .concat
idioms don’t seem to work here…full-analyst-32960
10/24/2022, 5:27 PMDockerBuild
at https://www.pulumi.com/registry/packages/docker/api-docs/image/ but I cannot find the documentation for the API online, I do see it in site-packages/pulumi_docker/docker.py
where can I find the online docs?full-analyst-32960
10/24/2022, 5:38 PMnutritious-battery-42762
10/29/2022, 12:09 PMcurved-kitchen-23422
10/29/2022, 3:41 PMerror: Domain resource has a problem: expected ebs_ options
.0.volume _type to be one of [stamdard gp2 io1], got gp3. Examine
values at
‘`Domain`.EbsOptions
.`VolumeType`’. Based on AWS docs, r6g.large.search instance type is support to gp3 volume and using console we can able to view the gp3 option, but using pulumi got the error. Can any one help to resolve this issue and thanks for advance.full-analyst-32960
10/31/2022, 2:38 PMfargate_task = awsx.ecs.FargateTaskDefinition("portal-fargate-task",
containers={
"nginx": awsx.ecs.TaskDefinitionContainerDefinitionArgs(
image="nginx",
essential=True,
memory=128,
log_configuration=awsx.ecs.TaskDefinitionLogConfigurationArgs(
log_driver="awslogs",
options=[
"awslogs_group:nginx-container",
"awslogs_region:us-west-1",
"awslogs_stream-prefix:nginx",
],
),
),
},
tags={
"Testing": "Testing",
},
)
full-analyst-32960
10/31/2022, 2:40 PMoptions: Optional[Any] = None
and I don’t know how to fill in a list of [Any] to keep “pulumi up” happyfull-analyst-32960
10/31/2022, 2:42 PMcannot unmarshal array into Go struct field LogConfiguration.LogConfiguration.Options of type map[string]*string
would hint that the options is a dict() (aka map) but I cannot get that to work eitherorange-airport-64592
11/01/2022, 1:58 AMArgument of type "dict[str, str | int]" cannot be assigned to parameter "variables" of type "Input[Mapping[str, Input[str]]] | None" in function "__init__"
Type "dict[str, str | int]" cannot be assigned to type "Input[Mapping[str, Input[str]]] | None"
"dict[str, str | int]" is incompatible with "Mapping[str, Input[str]]"
TypeVar "_VT_co@Mapping" is covariant
Type "str | int" cannot be assigned to type "Input[str]"
Type "int" cannot be assigned to type "Input[str]"
"dict[str, str | int]" is incompatible with protocol "Awaitable[Mapping[str, Input[str]]]"
"__await__" is not present
"dict[str, str | int]" is incompatible with "Output[Mapping[str, Input[str]]]"
...PylancereportGeneralTypeIssues
This is my code :
aws.lambda_.FunctionEnvironmentArgs(
variables={
"DESTN_BUCKET": s3_zip_log_bucket_name,
"RDS_HOSTNAME": "<http://xxxx.ap-east-1.rds.amazonaws.com|xxxx.ap-east-1.rds.amazonaws.com>",
"RDS_USERNAME": "admin",
"RDS_PASSWORD": db_password,
"RDS_PORT": "3306",
"TTL": 172800,
},
),
I think is need to do that to make dict convert to Input, But I don't know to do
orange-airport-64592
11/01/2022, 2:00 AMfull-analyst-32960
11/02/2022, 7:20 PMimport infra
is the infra this project, https://pypi.org/project/infra/? Or is that typo(?) for the testinfra package, https://testinfra.readthedocs.io/en/latest/ ?full-analyst-32960
11/03/2022, 1:23 AMregion = aws.get_region()
as one of the first API calls.
class PulumiMocks(pulumi.runtime.Mocks):
def new_resource(self, args: pulumi.runtime.MockResourceArgs):
print("new_resource")
return [args.name + '_id', args.inputs]
def call(self, args: pulumi.runtime.MockCallArgs):
print(f"XXXXX call:")
return {}
Narrowed down aws.get_region()
invokes the Mocks call(self, args: pulumi.runtime.MockCallArgs):
how do I extract that I am calling get_region() and return my Mock values? Maybe I’m missing something? I thought I would be able to add get_region()
method to the PulumiMocks() class? Any help would be appreciated.agreeable-businessperson-73427
11/03/2022, 11:40 PMagreeable-businessperson-73427
11/04/2022, 1:52 PMpwd = aws.secretsmanager.get_secret(arn=secret_obj.arn.apply(lambda arn: arn))
saw online that Output<T> would need to be converted using .apply() which is what I am trying to do with a lambda that returns the arn but that doesnt seem to be doing itagreeable-businessperson-73427
11/04/2022, 9:55 PMagreeable-businessperson-73427
11/05/2022, 7:51 PMagreeable-businessperson-73427
11/05/2022, 7:55 PMagreeable-businessperson-73427
11/05/2022, 7:55 PMthankful-stone-34269
11/10/2022, 12:11 AMmachine_role = aws.iam.Role("dockerbuilder-role", ...)
and then I try to create an EC2 instance that uses this role:
server = aws.ec2.Instance('dockerbuilder-pulumi',
iam_instance_profile=machine_role,
...)
The error message (which annoyingly takes 2 minutes to resolve annoyingly) is InvalidParameterValue: Value (dockerbuilder-role-908245c) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name
.
Now if I instantiate the Instance with `
iam_instance_profile="dockerbuilder-role-908245c",
it works. How do I get the name out of the role object to pass into the instance?careful-apartment-69053
11/14/2022, 3:25 PMBuilding wheel for pulumi-azure-native (setup.py): started
Building wheel for pulumi-azure-native (setup.py): finished with status 'error'
the above is where i get stuck. the program literally does not return from this:
pulumi new azure-python
being new here, I don't even know where to go to find logs or anything to help. Its unfortunately making me consider bypassing pulumi as an option for our future IaC since I can't even put together the first step of the POC for my developers.early-analyst-76866
11/15/2022, 7:52 AMCurrent stack outputs (1):
OUTPUT VALUE
vid vpc-0515230c3d5f949a8
I am able to reference my stack using stack_ref = pulumi.StackReference("PulumiPlay-dev")
but I am not sure how to print the value of vid now. I have tried using the get_output
method but it is not returning anything.brave-zoo-30030
11/15/2022, 1:36 PMif code != 0:
> raise create_command_error(result)
E pulumi.automation.errors.CommandError:
E code: 255
E stdout:
E stderr: error: could not get cloud url: could not load current project: could not validate '/tmp/automation-mad_5m7y/Pulumi.yaml': 3 errors occurred:
E * #/runtime: oneOf failed
E * #/runtime: expected string, but got object
E * #/runtime/options: expected object, but got null
early-analyst-76866
11/15/2022, 3:06 PMimport pulumi
stack_ref = pulumi.StackReference("inline_s3_project/dev")
obj = {"website_url": stack_ref.get_output("website_url").apply(
lambda s3_url: "https://" + s3_url
)}
print(obj)
The output that I am getting still shows me the object and not the value:
{'website_url': <pulumi.output.Output object at 0x109f9f2b0>}
quaint-match-50796
11/16/2022, 3:52 AMbroad-morning-80838
11/18/2022, 10:36 PMOutput[T]
. I'm trying to create a security group, then subsequently create security group rules using the id of the security group in the name of the rules. I've read through multiple threads here where people were trying to do similar things, and have tried to use solutions that worked for them (e.g. apply
etc) but am still stuck and very confused.
Here's the code in question:
# Create a security group for external ALBs
ext_alb_sg = SecurityGroup(
name="ext-alb-sg",
description="Security group for external load balancers",
)
ext_alb_sg_id = ext_alb_sg.id.apply(lambda id: id).apply(lambda id: f"{id}")
# Add rules to external ALB security group
ext_alb_inbound_rules = InboundSecurityGroupRules(
parent_sg_id=ext_alb_sg_id,
source_cidrs="0.0.0.0/0",
port=443,
)
ext_alb_outbound_rules = OutboundSecurityGroupRules(
parent_sg_id=ext_alb_sg_id,
destination_cidrs=VPC_CIDR,
port=80,
)
broad-morning-80838
11/18/2022, 10:39 PMext_alb_sg_id
to be a string, but I continue to get Calling __str__ on Output[T] is not supported
. Any guidance would be greatly appreciated!broad-morning-80838
11/18/2022, 10:47 PMlively-businessperson-96000
11/21/2022, 11:09 AMstale-answer-81646
11/21/2022, 10:14 PMerror: Program failed with an unhandled exception:
Traceback (most recent call last):
File "./__main__.py", line 34, in <module>
opts=pulumi.ResourceOptions(provider=cluster.provider),
AttributeError: 'Cluster' object has no attribute 'provider'
What is the best way to work around this issue?full-analyst-32960
11/22/2022, 12:21 AMValueError: unexpected input of type tuple
where in my code is the problem? I code base is large so I don’t want to post it and the error message to my newbie eyes does not tell me where to start looking. Complete error message below
Diagnostics:
pulumi:pulumi:Stack (pulumi_judging_portal-comap006):
E1121 18:11:33.224615000 4330784128 <http://fork_posix.cc:76]|fork_posix.cc:76]> Other threads are currently calling into gRPC, skipping fork() handlers
error: Program failed with an unhandled exception:
Traceback (most recent call last):
File "/opt/homebrew/bin/pulumi-language-python-exec", line 192, in <module>
loop.run_until_complete(coro)
File "/opt/homebrew/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/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/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
await wait_for_rpcs()
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/runtime/stack.py", line 73, in wait_for_rpcs
await RPC_MANAGER.rpcs.pop()
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/runtime/rpc_manager.py", line 68, in rpc_wrapper
result = await rpc
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/output.py", line 100, in is_value_known
return await is_known and not contains_unknowns(await future)
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/output.py", line 100, in is_value_known
return await is_known and not contains_unknowns(await future)
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/output.py", line 100, in is_value_known
return await is_known and not contains_unknowns(await future)
[Previous line repeated 5 more times]
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 514, in do_register
resolver = await prepare_resource(res, ty, custom, remote, props, opts, typ)
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 124, in prepare_resource
serialized_props = await rpc.serialize_properties(
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 207, in serialize_properties
result = await serialize_property(
File "/Users/tanner/projects/clients/comap.com/judging-portal/pulumi/venv/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 488, in serialize_property
raise ValueError(f"unexpected input of type {type(value).__name__}")
ValueError: unexpected input of type tuple