Datadog monitorjson in python
-
Initialize a new stack called:
dev
via pulumi stack init.pulumi stack init dev
-
Create a Python virtualenv, activate it, and install dependencies:
python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txt
-
View the current config settings. This will be empty.
pulumi config
KEY VALUE
-
Populate the config.
pulumi config set datadog:apiKey --secret XXXXXXXXXXXXXX pulumi config set datadog:appKey --secret YYYYYYYYYYYYYY
-
Changes to
__main__.py
to make it work.- Added
import json
to top of file. - Updated boolean values to
True
&False
. - Updated
priority
to a number, randomly selecting1
. - Removed
restricted_roles
due to following error:400 Bad Request: {"errors": ["Missing Roles set(['U', 'L', 'N'])"]}
on runningpulumi up
any time after the inital one.
- Added
-
Launch
pulumi up -y
Results
Updating (dev) View Live: https://app.pulumi.com/shaht/datadog-py-monitorjson/dev/updates/14 Type Name Status + pulumi:pulumi:Stack datadog-py-monitorjson-dev created + ├─ datadog:index:MonitorJson monitorJson created + └─ datadog:index:MonitorJson NoTrafficMVRCN created Outputs: monitor_json_name : "65191223" no_traffic_cn_name: "65191224" Resources: + 3 created Duration: 3s
-
View the outputs.
pulumi stack output
Results
Current stack outputs (2): OUTPUT VALUE monitor_json_name 65191223 no_traffic_cn_name 6519122
-
Clean up
pulumi destroy -y
-
Remove. This will remove the Pulumi.dev.yaml file also
pulumi stack rm dev -y