mysterious-hamburger-19066
05/25/2022, 6:31 PMquick-telephone-15244
05/26/2022, 6:38 PMdebug_error_string = "{"created":"@1653589486.232131000","description":"Error received from peer ipv4:127.0.0.1:64115","file":"src/core/lib/surface/call.cc","file_line":904,"grpc_message":"Cannot read properties of undefined (reading 'map')","grpc_status":2}"
quick-telephone-15244
05/26/2022, 6:40 PM-v=9
for up
and it's still not entirely clear how i'm getting to that/what the underlying issue is.purple-architect-30534
05/27/2022, 7:40 PMorange-crowd-9665
06/01/2022, 9:34 AMcrooked-sunset-90921
06/02/2022, 3:42 AMwhite-terabyte-21934
06/02/2022, 7:36 AMpulumi.output.Output object
.
• Would like to print these values via a print statement (like terraform output format) ,what is the best way to fetch the value via Ouput() method ?breezy-book-15761
06/02/2022, 9:43 AM"""A Google Cloud Python Pulumi program"""
import pulumi
import pulumi_gcp as gcp
cloud_resource_manager_api = gcp.projects.Service('crm_api', service="<http://cloudresourcemanager.googleapis.com|cloudresourcemanager.googleapis.com>")
project = gcp.organizations.get_project_output(opts=pulumi.InvokeOptions(parent=cloud_resource_manager_api))
cloud_run_api = gcp.projects.Service('cloud_run_api', disable_dependent_services=True, disable_on_destroy=True, project=project.id.apply(lambda project_id: project_id), service="<http://run.googleapis.com|run.googleapis.com>")
salmon-art-25154
06/02/2022, 6:52 PMpulumi update
and i've been trying to solve it since yesterday. the error is:
AttributeError: 'Service' object has no attribute 'status'full stack trace (https://pastebin.com/jS2FZpPK) initially, i was experiencing the issue described here https://github.com/pulumi/pulumi/issues/9694, which i was able to fix by pinning protobuf v3.20.1 after that though, i began experiencing the error i pasted above. i've tried downgrading pulumi as well as upgrading python (this app uses 3.9.6), but i get the same error no matter what. anyone else experience the same issue or have any tips to help me further debug this?
salmon-art-25154
06/02/2022, 7:34 PMpulumi.export('api_url', cloud_run_api_output.status.url)
but when i look at the docs for gcp.cloudrun.Service, i only see output.statuses, so maybe that changed between versions.
however when i try to access cloud_run_api_output.statuses[0]
, i get a index out of range error.salmon-art-25154
06/02/2022, 8:22 PMmicroscopic-holiday-73461
06/04/2022, 5:20 AMDiagnostics:
hcloud:index:Server (master-1):
error: hcloud:index/server:Server resource 'master-1' has a problem: Attribute must be a whole number, got 47074. Examine values at 'Server.PlacementGroupId'.
error: hcloud:index/server:Server resource 'master-1' has a problem: Attribute must be a whole number, got 1710474. Examine values at 'Server.Networks'.
Seems that the Server object expects IDs to come in as integers, but the objects provide IDs as strings.
Here's the relevant parts form the code:
import pulumi_hcloud as hcloud
network = hcloud.Network("cluster-net",
ip_range="10.0.1.0/24",
)
master_group = hcloud.PlacementGroup("masters", type="spread")
for i in range(3):
node = hcloud.Server(
f"master-{i+1}",
backups=False,
location="hel1",
server_type="CX21",
image="ubuntu-20.04",
networks=[{
"network_id": network.id,
}],
placement_group_id=master_group.id
)
hcloud.Rdns(
f"master-{i+1}",
server_id=node.id,
ip_address=node.ipv4_address,
dns_ptr=f"master-{i+1}.<http://kube.golyalpha.tk|kube.golyalpha.tk>"
)
The network and placement group gets created just fine beforehandmysterious-hamburger-19066
06/04/2022, 9:38 PMcrooked-sunset-90921
06/05/2022, 2:05 AMvictorious-exabyte-70545
06/06/2022, 7:45 PMvictorious-exabyte-70545
06/06/2022, 7:46 PMrabbitmq_chart = Chart(
'rabbitmq-chart',
ChartOpts(
resource_prefix=stack_name,
chart='rabbitmq',
version="8.16.2",
victorious-exabyte-70545
06/06/2022, 7:46 PMvictorious-exabyte-70545
06/06/2022, 7:48 PMdef transformation(args: ResourceTransformationArgs):
if args.type_ == "kubernetes:helm:template":
return ResourceTransformationResult(
props=args.props,
opts=ResourceOptions.merge(args.opts, ResourceOptions(
ignore_changes=["ChartOpts"],
)))
victorious-exabyte-70545
06/06/2022, 7:49 PMvictorious-exabyte-70545
06/06/2022, 7:49 PMdamp-fall-55922
06/07/2022, 8:46 PMaws
and aws-native
providers, preferring the native one where available and working.
it works fine, outperforms cloudformation as expected
I then moved that exact same code into a new file and wrapped it in class MyCustomFargateApp(pulumi.ComponentResource):
I passed `opts=pulumi.ResourceOptions(parent=self)`everywhere, and that’s all the changes I did
when I tried to deploy it, I got this error:
Diagnostics:
pulumi:providers:aws-native (default_5_7_0):
error: no resource plugin 'pulumi-resource-aws-native' found in the workspace at version v5.7.0 or on your $PATH, install the plugin using `pulumi plugin install resource aws-native v5.7.0`
which makes no sense because aws-native
is in v0.18.0 and it’s aws
that’s v5.7.0
to debug:
• I nuked venv and __pycache__
• I changed the name of the stack in Pulumi.yaml
• I removed both providers using pulumi plugin rm resource aws
etc
the results are the same
I did the same steps with the working stack without a ComponentResource, it deploys fine from scratch
I repeated the same steps with my broken stack but I commented out *every resource*… it deploys fine, just shows an empty MyCustomFargateApp resource. swell.
I then proceeded to remove comments from resources one by one.
working fine:
• pulumi_aws.route53.Record
• pulumi_aws.iam.Role
• pulumi_aws_native.logs.LogGroup
• pulumi_aws_native.ecs.TaskDefinition
• pulumi_aws.lb.TargetGroup
it blows up when I uncomment the pulumi_aws_native.elasticloadbalancingv2.ListenerRule
it does reference the TargetGroup which comes from aws-classic… but exact same stuff works if not wrapped in a ComponentResource
please advise, I’m losing my mindkind-jelly-61624
06/08/2022, 10:49 PMdamp-fall-55922
06/10/2022, 5:25 PMdamp-fall-55922
06/10/2022, 6:31 PMgreen-motorcycle-58080
06/11/2022, 12:59 PMpulumi up
wait until it's finished? If not, what's the best way to track progress of this script?creamy-whale-55909
06/12/2022, 5:55 PMpulumi.Output.all()
or apply()
. My observed behavior is sometimes, instead of getting access to the output value in it's expected form (ie str
), I am given the output object address memory (ie <pulumi.output.Output object at 0x7f02baf74b80>
).
I've seen a few folks in the channel struggling with the same problem. I think I understand why this is happening. Sharing my understanding below so folks can a)
confirm (or correct) my understanding and b)
benefit from the explanation (assuming it's correct 😅 ).
Here's the context... 🧵worried-gold-55244
06/13/2022, 10:20 PMquick-wolf-8403
06/14/2022, 2:32 AM__init__.py
lemon-processor-10785
06/14/2022, 8:04 PMdef set_route_tables(subnetIds):
for subnetId in subnetIds:
# Get the current routeTable for the subnet. Pulumi creates a new table for each subnet via awsx in vpc creation
routeTable=aws.ec2.get_route_table(subnet_id=subnetId)
# Create the route to MongoDB Atlas
mongoRoute=aws.ec2.Route(env + "-mongoroute-" + subnetId,
route_table_id=routeTable.id,
destination_cidr_block=mongoContainer.results[0].atlasCidrBlock,
vpc_peering_connection_id=mongoPeering.connectionId,
)
vpc.private_subnet_ids.apply(lambda subnetIds: set_route_tables(subnetIds))
creamy-whale-55909
06/15/2022, 12:36 AMget_caller_identity()
in order to grab the current account id of the locally assumed aws role so it can be used to define an arn in a policy doc:
(code snippet has been truncated to save space)
import pulumi_aws as aws
# gets account id
current = aws.get_caller_identity()
account_id = current.account_id
# passes account id when defining policy
self.lambda_policy = aws.iam.RolePolicy(
"lambdaPolicy",
role=self.lambda_role.name,
policy=self.my_lambda.name.apply(
lambda physical_name: json.dumps(
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "logs:CreateLogGroup",
"Resource": f"arn:aws:logs:us-east-1:{account_id}:*"
...
When I instantiate this component resource in my project __main__.py
, it works as expected. However, when I run pytest
, I get the following error:
________________________________ ERROR collecting tests/test_ip_scan.py _________________________________
tests/test_ip_scan.py:18: in <module>
test_args = ip_scan.MonitorAvailableIpsArgs(
<string>:9: in __init__
???
components/ip_scan.py:28: in __post_init__
account_id = aws.get_caller_identity().account_id
.venv/lib/python3.10/site-packages/pulumi_aws/get_caller_identity.py:106: in get_caller_identity
account_id=__ret__.account_id,
E AttributeError: 'NoneType' object has no attribute 'account_id'
Any and all feedback is greatly appreciated!