agreeable-angle-1483
02/20/2020, 2:31 PMStackReference
and print in the following example the other_output
variable, can anyone share an example?
other = StackReference("stg")
other_output = other.get_output("regions")
great-manchester-70568
02/20/2020, 7:40 PMaloof-psychiatrist-4562
02/21/2020, 8:15 PMendpoint_url
.aloof-psychiatrist-4562
02/21/2020, 9:09 PMPreviewing update (development):
Type Name Plan Info
pulumi:pulumi:Stack aws-pulumi-development
+ ├─ pulumi:providers:aws localstack create
└─ aws:s3:Bucket my-bucket 1 error
Diagnostics:
aws:s3:Bucket (my-bucket):
error: unable to discover AWS AccessKeyID and/or SecretAccessKey - see <https://pulumi.io/install/aws.html> for details on configuration
loud-midnight-95614
02/21/2020, 11:54 PMpulumi.debug()
output goes and how it can be used? I tried increasing the verbosity (I believe 9 is the highest), but none of my statements were printed to the screen. I tried finding a log file, but I'm probably not looking in the right place.
Basically, as I incrementally built my infrastructure "blueprint" with Pulumi, I used a lot of <http://pulumi.info|pulumi.info>()
statements to eye-ball verify different things. Now, as I prepare to share this work with a larger audience, it will be nice to reduce the noise on the screen by converting most of those to debug statements. But, I want to know how to access that information when a teammate asks me for help.better-actor-92669
02/24/2020, 9:15 AMstr
and not Output
. I know that it is asynchronous operation and the value may not be available right away, so I wrap it in a function as @white-balloon-205 recommended. For instance, I need to set up environmental variables to connect to a CloudSQL Postge Instance. I created a function, that does that, and then I want to pass an Output object as a string, not as an Output type:
import os
from pulumi_gcp.sql import DatabaseInstance, SslCert, User
from pulumi import Config, export, get_project, ResourceOptions, Output
def set_env_vars(env_var_name, env_var_value):
os.environ[env_var_name] = env_var_value
service_user_certificate = SslCert(
'service_user_certificate',
common_name=service_user_name,
opts=ResourceOptions(
depends_on=[cloud_pgsql_main_1, service_user],
protect=False,
),
instance=cloud_pgsql_main_1.name,
)
# Creating a Database Provider
Output.all(['PGSSLCERT', service_user_certificate.cert]).apply(set_env_vars)
Output.all(['PGSSLKEY', service_user_certificate.private_key]).\
apply(set_env_vars)
Output.all(['PGSSLROOTCERT', service_user_certificate.server_ca_cert]).\
apply(set_env_vars)
# set_env_vars('PGSSLCERT', Output.all([service_user_certificate.cert]).apply(lambda l: f"{l}"))
# set_env_vars('PGSSLKEY', str(service_user_certificate.private_key))
# set_env_vars('PGSSLROOTCERT', str(service_user_certificate.server_ca_cert))
print(os.environ['PGSSLCERT'])
print(os.environ['PGSSLKEY'])
print(os.environ['PGSSLROOTCERT'])
I tried different methods, however, environmental variables are not set up, because os.environ
can't find a key as it is not set up. Nevertheless, I can obviously check output of service_user_certificate.cert
via pulumi.export()
. Can you please help me figure out how to get a string value of an Output object?gifted-beach-2614
02/24/2020, 8:18 PMechoing-breakfast-73834
02/25/2020, 11:21 PMechoing-breakfast-73834
03/01/2020, 4:50 PMpulumi up
.loud-midnight-95614
03/05/2020, 12:12 AMpulumi.error()
is the expected behavior that it will only communicate an error to the user, but it will not disrupt the execution flow or terminate the program early?
I just noticed that I could continue provisioning resources even after encountering an error message; which functionally makes it equivalent to a warning (at least to me). Just wanted to double check before I implement my own logic for "fatal errors".famous-salesmen-28835
03/05/2020, 6:18 AMclass pulumi_aws.s3.Bucket(resource_name, opts=None, acceleration_status=None, acl=None, arn=None, bucket=None, bucket_prefix=None, cors_rules=None, force_destroy=None, hosted_zone_id=None, lifecycle_rules=None, loggings=None, object_lock_configuration=None, policy=None, region=None, replication_configuration=None, request_payer=None, server_side_encryption_configuration=None, tags=None, versioning=None, website=None, website_domain=None, website_endpoint=None, __props__=None, __name__=None, __opts__=None)
In this if I pass resource_name as "mybucket" then it create s3 bucket with name "mybucket-677282" is it any way to create bucket with my bucket only. Or any one can suggest me this have policy field so if I pass policy in that "resource" needs the ARN of bucket which is not created with a single call how I can create bucket with attached policycolossal-room-15708
03/09/2020, 3:52 AMbright-refrigerator-27211
03/10/2020, 8:13 AMpolite-iron-99873
03/10/2020, 7:46 PMsome_other_resource = foo.resource("foores", s3_bucket_id = bucket1.id, ...)
...
bucket1 = s3.bucket("bucket1", ...args)
This would be likened to Interpolation in terraform. Or tropospheres ability to use Ref('<resource_name>').elegant-crayon-4967
03/11/2020, 12:04 AMpassword = pulumi.output(aws.secretsmanager.getSecret({
name: `testSecret`,
},
spits out a unhandled exception. I’d like to capture this nicely and exit and not explode the program. First attempt using try/catch didn’t stop it from explodingtall-stone-8237
03/11/2020, 6:24 AMwide-cat-87818
03/11/2020, 7:29 AMnutritious-shampoo-16116
03/11/2020, 1:28 PMpolicy
here https://www.pulumi.com/docs/reference/pkg/python/pulumi_aws/iam/#pulumi_aws.iam.Policy ? is it a str? dict?nutritious-shampoo-16116
03/11/2020, 1:28 PMbright-refrigerator-27211
03/11/2020, 1:50 PMnutritious-shampoo-16116
03/11/2020, 1:51 PMbright-refrigerator-27211
03/11/2020, 1:51 PMbright-refrigerator-27211
03/11/2020, 1:51 PMbright-refrigerator-27211
03/11/2020, 1:52 PMnutritious-shampoo-16116
03/11/2020, 1:52 PMbright-refrigerator-27211
03/11/2020, 1:53 PMbright-refrigerator-27211
03/11/2020, 1:55 PMnutritious-shampoo-16116
03/11/2020, 2:10 PMnutritious-shampoo-16116
03/11/2020, 2:10 PMpolite-iron-99873
03/11/2020, 2:39 PMpolicy=
{
"Version": "2012-10-17",
"Statement": [{
"Action": [
"logs:PutLogEvents",
"logs:CreateLogStream",
"logs:DescribeLogGroups",
"logs:DescribeLogStreams"
],
"Effect": "Allow",
"Resource": 'arn:aws:logs:us-east-1:xxxxxxxxx:log-group:/aws/vpc/' + vpc.id + '/flows/*'
}]
})