little-river-49422
04/02/2019, 12:21 PMincalculable-sundown-82514
04/02/2019, 5:19 PMoutput.apply
anywhere, as long as the promise that gets returned is awaited by something (a resource or by exporting using pulumi.export
)little-river-49422
04/02/2019, 8:49 PMincalculable-sundown-82514
04/02/2019, 8:53 PMlittle-river-49422
04/02/2019, 9:06 PMincalculable-sundown-82514
04/02/2019, 9:07 PMlittle-river-49422
04/02/2019, 9:07 PMif not pulumi.runtime.is_dry_run():
asyncio.ensure_future(create_sql_database_from_existing())
async def create_sql_database_from_existing():
sql_client = client_factory('SqlManagementClient')
async_db_create = await sql_client.databases.create_or_update(
gen_name(BRANCH),
gen_name(BRANCH),
'TslTest',
{
'location': LOCATION,
'create_mode': 'Copy',
'sourceDatabaseId': DBID
}
)
async_db_create.result()
incalculable-sundown-82514
04/02/2019, 9:08 PMapply
for this. does that not work?little-river-49422
04/02/2019, 9:09 PMincalculable-sundown-82514
04/02/2019, 9:09 PMlittle-river-49422
04/02/2019, 9:14 PMsql_server.name.apply(lambda name: name),
Can not perform requested operation on nested resource. Parent resource '<pulumi.output.Output object at 0x7f3aac273860>' not found.
incalculable-sundown-82514
04/02/2019, 9:14 PMapply
returns something of type Output
little-river-49422
04/02/2019, 9:15 PM"{}".format(name)
?incalculable-sundown-82514
04/02/2019, 9:15 PMname
, it’s type is “string”name
inside the lambdalittle-river-49422
04/02/2019, 9:16 PMsql_server.name.apply(lambda name: "{0}".format(name)),
incalculable-sundown-82514
04/02/2019, 9:16 PMlittle-river-49422
04/02/2019, 9:16 PMincalculable-sundown-82514
04/02/2019, 9:17 PMname
little-river-49422
04/02/2019, 9:17 PMincalculable-sundown-82514
04/02/2019, 9:17 PMlittle-river-49422
04/02/2019, 9:17 PMincalculable-sundown-82514
04/02/2019, 9:17 PMapply
with an async functionlittle-river-49422
04/02/2019, 9:17 PMincalculable-sundown-82514
04/02/2019, 9:18 PMlittle-river-49422
04/02/2019, 9:18 PMincalculable-sundown-82514
04/02/2019, 9:18 PMlittle-river-49422
04/02/2019, 9:18 PMincalculable-sundown-82514
04/02/2019, 9:32 PMlittle-river-49422
04/02/2019, 9:32 PMawait sql_server.name.apply(lambda name: sql_client.databases.create_or_update(
gen_name(BRANCH),
name,
'TslTest',
{
'location': LOCATION,
'create_mode': 'Copy',
'sourceDatabaseId': DBID
}
)
)
proud-artist-4864
04/03/2019, 6:10 AMlittle-river-49422
04/03/2019, 8:05 AMproud-artist-4864
04/03/2019, 8:09 AMlittle-river-49422
04/03/2019, 8:52 AMproud-artist-4864
04/03/2019, 10:03 AM