bright-refrigerator-27211
03/11/2020, 10:59 PMbright-refrigerator-27211
03/11/2020, 10:59 PMbright-refrigerator-27211
03/11/2020, 11:01 PMechoing-breakfast-73834
03/12/2020, 3:47 PMAWS_REGION
)
• Pull from the stack config
• Set a global variable
• Add a 'region' parameter to every dynamic provider
• Extend ResourceOptions, adding a 'region' parameter, and passing it to my provider in my resource constructor
Unfortunately all of these are either have a lot of coupling or add a decent amount of boilerplate code to each provider.flat-advantage-89110
03/12/2020, 7:46 PMdevRole = pulumi_postgresql.role.Role(f'developers-{i}',
connection_limit=100,
create_database=True,
login=True,
name=userlist[i],
password='password',
skip_reassign_owned=True,
opts=ResourceOptions(provider=postgresProvider, depends_on=[postgresProvider]))
running results in a PostgreSQL version: dial tcp :5432: connect: connection refused
So I assumed it was because tf2pulumi
didn’t handle provider "postgresql"
, so I added that and set the provider but I’m still getting the same error. is there somewhere I can find a python example of how to use postgres with pulumi?flat-advantage-89110
03/12/2020, 7:57 PMworried-plastic-45846
03/13/2020, 4:27 PM<BUCKET>
with a bucket.id
.
userScript.replace('<BUCKET_NAME>', bucket.id)
causes the error "Expected type 'str', got 'Output[str]' instead"
, which makes perfect sense.
Could someone please tell me how I can tell Pulumi to execute this replacement only after the bucket resource has been created? (similar to what I usually pulumi.Output.concat()
).victorious-helmet-11068
03/14/2020, 8:36 AMvictorious-helmet-11068
03/14/2020, 8:36 AMfaint-table-42725
03/14/2020, 5:09 PMvictorious-helmet-11068
03/14/2020, 5:22 PMwonderful-plastic-88586
03/14/2020, 11:41 PMfamous-salesmen-28835
03/18/2020, 3:55 AMPreviewing update (pulumi-test):
pulumi:pulumi:Stack pulumi-test-pulumi-test Traceback (most recent call last):
pulumi:pulumi:Stack pulumi-test-pulumi-test File \"/root/.pulumi/bin/pulumi-language-python-exec\", line 14, in <module>
pulumi:pulumi:Stack pulumi-test-pulumi-test import pulumi
pulumi:pulumi:Stack pulumi-test-pulumi-test ImportError: No module named 'pulumi'
pulumi:pulumi:Stack pulumi-test-pulumi-test It looks like the Pulumi SDK has not been installed. Have you run pip install?
pulumi:pulumi:Stack pulumi-test-pulumi-test If you are running in a virtualenv, you must run pip install -r requirements.txt from inside the virtualenv.
pulumi:pulumi:Stack pulumi-test-pulumi-test error: an unhandled error occurred: Program exited with non-zero exit code: 1
pulumi:pulumi:Stack pulumi-test-pulumi-test 1 error; 6 messages
Diagnostics:
pulumi:pulumi:Stack (pulumi-test-pulumi-test):
Traceback (most recent call last):
File \"/root/.pulumi/bin/pulumi-language-python-exec\", line 14, in <module>
import pulumi
ImportError: No module named 'pulumi'
It looks like the Pulumi SDK has not been installed. Have you run pip install?
If you are running in a virtualenv, you must run pip install -r requirements.txt from inside the virtualenv.
error: an unhandled error occurred: Program exited with non-zero exit code: 1
If I go and check my python env then I am not getting any import error
root@b43ba04ea07e:/# /opt/ns/python-apps/resourcecreation/app-env/bin/python
Python 3.7.4 (default, Sep 2 2019, 20:44:09)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pulumi
>>>
In this I am not getting this error but I have created API which will call the CLI so I am executing my code on my machine
/opt/ns/python-apps/resourcecreation/app-env/bin/python /opt/ns/python-apps/resourcecreation/app-env/lib/python3.7/site-packages/resourcecreation/app.py
Then I am getting error
So Can any one tell me is it any way that while calling pulumi commands I point my python binary instead of taking machine default binary?loud-oyster-36834
03/18/2020, 1:28 PMrequested_service_objective_name
param with the sql.Database
resource.
However, it seems like the import_
param mess things up by try to re-import/create the database again, even if it already exists.
sql.DatabasesClient#CreateImportOperation: Failure sending request: StatusCode=400 -- Original Error: Code="Failed" Message="The async operation failed." InnerError={"unmarshalError":"json: cannot unmarshal array into Go struct field serviceError2.details of type map[string]interface {}"} AdditionalInfo=[{"code":"0","details":[{"code":"0","message":"There was an error that occurred during this operation : '\u003cstring xmlns=\"<http://schemas.microsoft.com/2003/10/Serialization/>\"\u003eError encountered during the service operation. ; Exception Microsoft.SqlServer.Management.Dac.Services.ServiceException:Target database is not empty. The import operation can only be performed on an empty database.; \u003c/string\u003e'","severity":"16","target":null}],"innererror":[],"message":"There was an error that occurred during this operation : '\u003cstring xmlns=\"<http://schemas.microsoft.com/2003/10/Serialization/>\"\u003eError encountered during the service operation. ; Exception Microsoft.SqlServer.Management.Dac.Services.ServiceException:Target database is not empty. The import operation can only be performed on an empty database.; \u003c/string\u003e'","target":null}]
The change of the price tier and DTU works fine behind the scenes. After refreshing the resources everything works as expected.
Am I doing something wrong here, or is there some way of ignoring the import during resource updates?
database = sql.Database(
resource_name="my_database",
name="my_database",
resource_group_name=resource_group.name,
server_name=sql_server.name,
requested_service_objective_name=config.get('database.service_objective') or "S0",
import_={
"administrator_login":sqlserver_username,
"administrator_login_password": sqlserver_random_password.result,
"operation_mode":"Import",
"authentication_type":"SQL",
"storage_key":storage_account_bacpac.primary_access_key,
"storage_key_type":"StorageAccessKey",
"storage_uri":storage_blob_uri
})
My initial thought was to check if the database already exists with sql.get_database
and change the import block based on the result, but that seems like a messy solution?victorious-helmet-11068
03/20/2020, 2:38 PMvictorious-helmet-11068
03/20/2020, 2:38 PMenough-oil-63049
03/23/2020, 3:53 AMminiature-art-58368
03/24/2020, 7:59 PMbillions-ability-33213
03/27/2020, 5:28 PMiam
roles that gonna be used for multiple resources (example : group of lambdas that use the same role). The problem is that the lambdas are created in a for
loop . If I put the creation of the iam role inside as role.arn
I get duplicates URN... Any advise/example how I should do this ?colossal-room-15708
03/31/2020, 12:06 AMcidrsubnet
in pulumi?nutritious-shampoo-16116
03/31/2020, 1:47 PMnutritious-shampoo-16116
03/31/2020, 1:48 PMaws ec2 associate-address --instance-id $INSTANCE_ID --allocation-id <pulumi.output.Output object at 0x7f9fb51fd700>\n--==BOUNDARY==--\n"
colossal-room-15708
03/31/2020, 11:00 PMfor
loop here?
vnet = network.VirtualNetwork('ssvc-vnet',
resource_group_name=resource_group.name,
name="ssvc-vnet-{0}".format(stack_name),
address_spaces=[ssvc_vnet_space],
subnets= [
for subnet in subnet_config:
{
name=subnet[0],
address_prefix=subnet[1],
virtual_network_name=vnet.name
)
},
]
)
It's syntactically incorrect, so I'm wondering what the best way to get this done anyways might be.nutritious-shampoo-16116
04/01/2020, 10:46 AMnutritious-shampoo-16116
04/01/2020, 10:46 AMnutritious-shampoo-16116
04/01/2020, 10:49 AMnutritious-shampoo-16116
04/01/2020, 10:59 AMrich-easter-89163
04/01/2020, 4:43 PMpulumi_aws.get_region()
green-morning-1318
04/02/2020, 1:57 AMbillowy-laptop-45963
04/03/2020, 6:19 PM