broad-finland-69602
11/26/2019, 1:17 PMpulumi up
had to be run twice in order to create the resources. First time it creates the table and the second time it creates it the item inside the table.
import json
import pulumi
from pulumi_aws import dynamodb
table_default_name = dynamodb.Table(
'pulumi-poc-test-table',
hash_key='id',
attributes=[
{'name': 'id', 'type': 'S'}
],
write_capacity=1,
read_capacity=1
)
debug_object_1 = \
table_default_name.name.apply(lambda table_name: \
dynamodb.TableItem(
'test_item',
hash_key='id',
item=json.dumps({'id': {'S': 'yes'}}),
table_name=table_name
)
)
broad-dog-22463
11/26/2019, 1:25 PMbroad-finland-69602
11/26/2019, 1:26 PMbroad-dog-22463
11/26/2019, 1:28 PMbroad-finland-69602
11/26/2019, 1:29 PMpulumi up
twice in order for the actual creation to happen (although it does detect it the first time around)broad-dog-22463
11/26/2019, 1:30 PMbroad-finland-69602
11/26/2019, 1:32 PMbroad-dog-22463
11/26/2019, 1:38 PMimport json
import pulumi
from pulumi_aws import dynamodb
table_default_name = dynamodb.Table(
'pulumi-poc-test-table',
hash_key='id',
attributes=[
{'name': 'id', 'type': 'S'}
],
write_capacity=1,
read_capacity=1
)
item = dynamodb.TableItem(
'test_item',
hash_key='id',
item=json.dumps({'id': {'S': 'yes'}}),
table_name=table_default_name.name
)
)
broad-finland-69602
11/26/2019, 1:38 PMbroad-dog-22463
11/26/2019, 1:38 PMbroad-finland-69602
11/26/2019, 1:38 PMbroad-dog-22463
11/26/2019, 1:38 PMbroad-finland-69602
11/26/2019, 1:38 PMbroad-dog-22463
11/26/2019, 1:39 PMbroad-finland-69602
11/26/2019, 1:40 PMbroad-dog-22463
11/26/2019, 1:43 PMbroad-finland-69602
11/26/2019, 1:43 PMbroad-dog-22463
11/26/2019, 1:44 PMbroad-finland-69602
11/26/2019, 1:54 PMprocessing_job = \
bucket.bucket.apply(lambda bucket_name: \
entrypoint_script.key.apply(lambda script_key: \
framework_lib.key.apply(lambda framework_lib_key: \
pulumi.Output.all(*[dep.key for dep in glue_deps]).apply(lambda dep_keys: \
glue.Job(**<http://name.me|name.me>('pulumi-poc-process-file'),
role_arn=glue_role.arn,
command={
'name': 'pythonshell',
'pythonVersion':'3',
'scriptLocation': f's3://{bucket_name}/{script_key}'
},
opts=pulumi.ResourceOptions(depends_on=[entrypoint_script, bucket])
,
default_arguments={
# [f's3://{bucket_name}/{dep_key}' for dep_key in dep_keys] +
'--extra-py-files': ','.join([f's3://{bucket_name}/{framework_lib_key}'])
}
)
))))
broad-dog-22463
11/26/2019, 2:11 PMs3://{bucket_name}/{script_key}
broad-finland-69602
11/26/2019, 2:15 PM.apply
or it will behave strange.broad-dog-22463
11/26/2019, 2:27 PMconst fooAlertChannel = new newrelic.AlertChannel("foo", {
configuration: {
include_json_attachment: "1",
recipients: "<mailto:foo@example.com|foo@example.com>",
},
type: "email",
});
const fooAlertPolicy = new newrelic.AlertPolicy("foo", {});
const fooAlertPolicyChannel = new newrelic.AlertPolicyChannel("foo", {
channelId: fooAlertChannel.id.apply(id => parseInt(id)),
policyId: fooAlertPolicy.id.apply(id => parseInt(id)),
});
broad-finland-69602
11/26/2019, 2:33 PMbroad-dog-22463
11/26/2019, 2:37 PM