Skip to content

Commit

Permalink
Update Day 47 content
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabkumar7 committed Feb 20, 2023
1 parent 2cdd212 commit c736642
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion 2023/day47.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Python is a popular language for infrastructure management, and there are severa

## Fabric

Fabric is a Python library that can be used for streamlining SSH commands and remote execution of scripts, which can be used to automate server configuration and deployment
Fabric is a Python library that can be used for streamlining SSH commands and remote execution of scripts, which can be used to automate server configuration and deployment.
Here is an example in which we will be using the Fabric library to connect to a remote server using SSH, and then run the `ls -l` command on the remote server. The output of the command will be printed to the console.

``` python
Expand All @@ -29,3 +29,34 @@ print(result.stdout)
## PyWinRM

A Python library that can be used to automate Windows Remote Management tasks, which can be used to automate Windows server configuration and management.

## Pulumi

Pulumi is a cloud infrastructure as code (CIaC) tool that lets you define and manage cloud resources in a variety of programming languages, including Python.

You can use Pulumi to write Python code to describe your infrastructure as code, and then use the Pulumi CLI to deploy and manage it. Here is an example:

``` python
import pulumi
from pulumi_aws import ec2

# Define an EC2 instance
server = ec2.Instance('server',
instance_type='t2.micro',
ami='ami-0c55b159cbfafe1',
tags={
'Name': 'cloud-server',
},
)

# Export the server's IP address
pulumi.export('ip_address', server.public_ip)
```

In this example, we're using the Pulumi Python SDK to define an EC2 instance on AWS. We specify the instance type, the AMI ID, and some tags for the instance, and then export the instance's public IP address. ou can then use the Pulumi CLI to deploy this infrastructure, which will create the EC2 instance on AWS. You can also use the Pulumi CLI to manage your infrastructure over time, making changes and updates as needed.

## Resources:

- [Learn more about Fabric]()
- [PyWinRM](https://github.com/diyan/pywinrm)
- [Pulumi - IaC Tool](https://www.pulumi.com/docs/reference/pkg/python/pulumi/)

0 comments on commit c736642

Please sign in to comment.