echoing-dinner-19531
05/06/2023, 10:16 AMIs there any way to propagate tags to all resources using YAML?Currently no. There's no support for stack transforms, we've been thinking about maybe enabling that via an external policy but might also be worth supporting some simple transforms in yaml directly so feel free to raise a request.
How can I use Stack Reference with YAMLYes, the code you posted to the thread looks right to me but it does look like the docs pages is missing a section. Raised an issue for that https://github.com/pulumi/pulumi-hugo/issues/2798
Can I use logic and loops in YAML?No the design is intended to be for very simple uses cases, our thinking is if you need logic and loops you shouldn't be using YAML. There is an issue for this https://github.com/pulumi/pulumi-yaml/issues/191 but the current stand is either upgrade to a full language (which is what
pulumi convert
helps with) or use a templating system like CUE or Jinja.
Figuring out arrays in YAML was a huge pain in the ass.Structured config like arrays and objects is still being improved. As you've pointed out the errors aren't great because it's pretty much a raw dump of the schema validation, we have an issue tracking that at https://github.com/pulumi/pulumi/issues/11129.
My major blocker now is the array from configuration. Why is this so terrible?I think (and I haven't touched the yaml codebase for a bit) because yaml never had support for arrays or objects as config. The engine can handle them but YAML doesn't. I'm working on a new set of tests to cover all the language to makes sure they're consistent about their support for config values. Fixing this should fall out from that work.
This seems to successfully get the vpc, but how do make it a local resource?Not totally sure what your asking here given the code snippet? Do you mean how do you define a vpc resource for pulumi to create instead of get?
gifted-cat-49297
05/19/2023, 2:11 PMrich-motorcycle-71684
05/29/2023, 9:36 AMALLOWED_HOSTS
of my app. Therefore the LB thinks the target is unhealthy and pulumi times outrich-motorcycle-71684
05/30/2023, 3:58 AMsg_allowPostGresFromECS:
type: aws:ec2:SecurityGroup
properties:
description: Pulumi managed. Allow Postgres inbound traffic from ECS.
ingress:
- description: Postgres from ECS.
fromPort: 0
toPort: 5432
protocol: tcp
securityGroups:
- ${???????}
egress:
- fromPort: 0
toPort: 0
protocol: "-1"
cidrBlocks:
- 0.0.0.0/0
freezing-kitchen-80795
06/01/2023, 5:49 PMbrash-hairdresser-60389
06/28/2023, 1:09 PMstraight-fireman-55591
08/04/2023, 11:14 AMgke-cluster:
type: gcp:container:Cluster
.
.
.
# Now crating a namespace:
ray-system:
type: kubernetes:core/v1:Namespace
properties:
metadata:
name: ray-system
options:
provider: ${gke-cluster}
dependsOn:
- ${gke-cluster}
# This gets me an error:
error: resource passed as Provider was not a provider resource '&{{{{{%!s(int32=0) %!s(uint32=0)} %!s(uint32=0) %!s(uint32=0) %!s(int32=0) %!s(int32=0)} {%!s(*pulumi.OutputState=&{0x140005a46c0 0x140004083f0 0 <nil> <nil> false false 0x101cc4480 [0x140006c02a0]})} {%!s(*pulumi.OutputState=&{0x140005a4680 0x140004083f0 0 <nil> <nil> false false 0x101bd6980 [0x140006c02a0]})} map[] map[] <nil> [] gke-cluster [] %!s(bool=false)} {%!s(*pulumi.OutputState=&{0x140005a4640 0x140004083f0 0 <nil> <nil> false false 0x101cc42c0 [0x140006c02a0]})}} gke-cluster {%!s(*pulumi.OutputState=&{0x140005a4600 0x140004083f0 0 <nil> <nil> false false 0x101bf6dc0 [0x140006c02a0]})}}'
# If I try:
provider: ${gke-cluster.name}
or provider: ${gke-cluster.id}
I get an error: return: error: resource cannot be an output
I'n not sure how to create a provider for above gke cluster using: type: pulumi:providers:gcp
straight-fireman-55591
08/04/2023, 11:24 AMstraight-fireman-55591
08/07/2023, 10:52 AMNote: There are over 200 nested types for this resource. Only the first 200 types are included in this documentation.
straight-fireman-55591
08/08/2023, 9:56 AMgoogle-native:container/v1beta1:Cluster
that worked fine, the cluster is up. THe nodepools are up.
The helm part of yaml was ignored and not installed on the cluster. What do I do wrong ?
The shortened version of my YAML:
gke-cluster-native:
type: google-native:container/v1beta1:Cluster
properties:
...
nginx-ingress:
type: kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release>
properties:
...
kuberay-operator:
type: kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release>
properties:
...
straight-fireman-55591
08/08/2023, 10:46 AMstraight-fireman-55591
08/14/2023, 3:31 PMpayloadUrl : "<https://hooks.slack.com/services>..............
2nd issue - + pulumiservice:index:Webhook stackWebhook **creating failed** error: failed to create webhook: 401 API error: Unauthorized: No credentials provided or are invalid.
- which credentials? The webhook is public and it works with a simple curl
stackWebhook:
type: pulumiservice:index:Webhook
properties:
active: true
displayName: "#channel"
organizationName: company
payloadUrl: ${slackwebhook.value}
format: slack
variables:
slackwebhook:
fn::invoke:
function: gitlab:getProjectVariable
arguments:
key: SLACK_WEBHOOK_URL
project: REDACTED_ID_OF_GITLAB
straight-fireman-55591
08/15/2023, 3:54 PMworried-helmet-23171
08/16/2023, 9:42 PMworried-helmet-23171
08/18/2023, 1:54 PMworried-helmet-23171
11/08/2023, 12:44 AMgifted-gigabyte-53859
11/14/2023, 6:58 AMPulumi.yaml
file? e.g. dynamo-db-tables.yaml
, api-gateways.yaml
etc then include
them in the main Pulumi.yaml
file somehow?gifted-gigabyte-53859
11/14/2023, 7:05 AM${this.properties.name}
instead of ${unique-name-of-reqsource.properties.name}
gifted-gigabyte-53859
11/14/2023, 7:13 AMgifted-gigabyte-53859
11/14/2023, 8:10 AM# Pulumi.develop.yaml
config:
myproject:myvar: false
# Pulumi.yaml
resources:
myresource:
options:
protect: ${pulumi.stack}.${myvar}
properties:
...
The above gives an error
error: failed to discover plugin requirements:
-error: Pulumi.yaml:71,16-42: protect must be a boolean value;
If I try to force it:
options:
protect: !!bool ${pulumi.stack}.${myvar}
It doesn't work:
error: could not unmarshal '.../Pulumi.yaml': invalid YAML file: yaml: cannot decode !!str `${pulumi.stack}.${protect_dynamodb_tables}` as a !!bool
I also tried passing it through the variables:
section in Pulumi.yaml
# Pulumi.yaml
...
variables:
varProtectTablesAsBool:
type: bool
value: ${pulumi.stack}.${protect_dynamodb_tables} # tried both with !!bool and without
Still doesn't work, giving the first error protect must be a boolean value;
gifted-gigabyte-53859
11/29/2023, 8:27 AMapi-gateway
provider? For example I'm reading here: https://www.pulumi.com/registry/packages/aws-apigateway/api-docs/restapi/
This is where I've got up to
##
# Admin
# A REST API to route requests to the admin/config Lambda functions
api_admin:
type: aws-apigateway:RestAPI
options:
version: 2.0.1
properties:
routes:
##
# Lambda targets
# CKO resource name: auth
- eventHandler: ${lambda_admin_auth}
method: GET
path: /admin/auth
# CORS / OPTIONS stuff
- path: /admin/auth
method: OPTIONS
target:
type: mock
uri: "what"
gifted-gigabyte-53859
11/30/2023, 8:03 AMstatusCode: Cannot assign type 'number' to type 'aws-apigateway:index:SwaggerGatewayResponse'
but in the docs, it says that statusCode is a number 🤔aloof-sundown-66103
12/17/2023, 1:52 AMPulumi.yaml
?gifted-gigabyte-53859
12/18/2023, 6:11 AMPulumi.yaml
and pulumi seems blind to them. pulumi preview
shows no sign of them.
I can introduce arbitrary properties and there is no error.
See screenshot hello: hi
throws no error.gifted-gigabyte-53859
12/21/2023, 4:30 AM${myvar:-fallbackvalue}
in bashfast-vase-27755
01/09/2024, 2:34 AMgifted-gigabyte-53859
01/09/2024, 8:41 AMbrash-gigabyte-81569
02/06/2024, 9:01 PMlemon-pilot-19367
02/21/2024, 10:20 PMerror resolving type of resource awsLoadBalancerControllerRelease: Helm Chart resources are not supported in YAML, consider using the Helm Release resource instead: <https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/>
I tried the resource kubernetes:helm.sh/v3:Release, but it does not have kubeconfig in its input parameters.
I tried to connect Kubernetes as a provider, but also without success.
Is there a way to do it?green-bear-87070
02/22/2024, 7:39 AM