Skip to content

Latest commit

 

History

History

datadog-py-monitorjson

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Datadog monitorjson

Datadog monitorjson in python

Deployment

  1. Initialize a new stack called: dev via pulumi stack init.

    pulumi stack init dev
  2. Create a Python virtualenv, activate it, and install dependencies:

    python3 -m venv venv
    source venv/bin/activate
    pip3 install -r requirements.txt
  3. View the current config settings. This will be empty.

    pulumi config
    KEY                     VALUE
  4. Populate the config.

    pulumi config set datadog:apiKey --secret XXXXXXXXXXXXXX 
    pulumi config set datadog:appKey --secret YYYYYYYYYYYYYY
  5. 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.
    • Removedrestricted_roles due to following error: 400 Bad Request: {"errors": ["Missing Roles set(['U', 'L', 'N'])"]} on running pulumi up any time after the inital one.
  6. 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
    
  7. View the outputs.

    pulumi stack output

    Results

     Current stack outputs (2):
     OUTPUT              VALUE
     monitor_json_name   65191223
     no_traffic_cn_name  6519122
  8. Clean up

    pulumi destroy -y
  9. Remove. This will remove the Pulumi.dev.yaml file also

    pulumi stack rm dev -y