Skip to content

Latest commit

 

History

History

aws-classic-py-get-ami

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

AWS Get AMI in python

AWS get ami function 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. Here are aws endpoints

    pulumi config set aws:region us-east-2 # any valid aws region
  5. Run pulumi up

    pulumi up

    Results

    Updating (dev)
    
    View Live: https://app.pulumi.com/shaht/aws-classic-py-get-ami/dev/updates/1
    
       Type                 Name                        Status      
    +   pulumi:pulumi:Stack  aws-classic-py-get-ami-dev  created     
    
    Outputs:
       my_ami: "amzn2-ami-hvm-2.0.20190618-x86_64-gp2"
    
    Resources:
       + 1 created
    
    Duration: 4s
  6. View the outputs

    pulumi stack output

    Results

    Current stack outputs (1):
     OUTPUT  VALUE
     my_ami  amzn2-ami-hvm-2.0.20190618-x86_64-gp2
  7. Clean up

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

    pulumi stack rm dev -y