Provision Amazon Linux 2 EC2 with static IP and ports 22, 80, 443 and 10051 open in the security group.
sudo yum update -y| VMware Workstation | |
| ====================================== | |
| $sudo dmidecode -s system-product-name | |
| Output ==> VMware Virtual Platform | |
| VirtualBox | |
| ====================================== | |
| $sudo dmidecode -s system-product-name |
| #!/bin/bash | |
| # | |
| # | |
| # Run as root or sudo su | |
| # | |
| #set -x | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "This script requires elevated permissions." | |
| echo "Please run this script as sudo or root." | |
| exit |
| Param( $AWSRegion = 'us-east-1', $AWSProfileName = 'default') | |
| # | |
| # Store your AWS credentials using the following Powershell AWS command: | |
| # | |
| # Set-AWSCredentials -AccessKey {xx} -SecretKey {xx} -StoreAs {MyProfileName} | |
| # | |
| # Example: | |
| # | |
| # Set-AWSCredentials -AccessKey 'AKIAVJL...OB4XN' -SecretKey 'oxLcrpnd3S+...8e2Me' -StoreAs 'testprofile' | |
| # Set-DefaultAWSRegion us-east-1 |
| output "workspace_name" { | |
| value = "${lower(terraform.workspace)}" | |
| description = "Terraform Workspace Name" | |
| sensitive = false | |
| } |
| data "aws_caller_identity" "current" {} | |
| output "account_id" { | |
| value = "${data.aws_caller_identity.current.account_id}" | |
| } | |
| output "caller_arn" { | |
| value = "${data.aws_caller_identity.current.arn}" | |
| } |
| # escape=` | |
| # use .NET Framework image with WindowsServerCore | |
| FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 | |
| WORKDIR /app | |
| # copy published application files inside the image | |
| COPY _artifacts/appfiles /. | |
| # configure web servers to bind to port 80 when present | |
| ENV ASPNETCORE_URLS=http://+:80 ` |
| docker images | grep -v REPOSITORY | awk '{print $1}' | xargs -L1 docker pull |
| import boto3 | |
| ec2_resource = boto3.resource('ec2') | |
| # Make a list of existing volumes | |
| all_volumes = ec2_resource.volumes.all() | |
| volumes = [volume.volume_id for volume in all_volumes] | |
| # Find snapshots without an existing volume | |
| snapshots = ec2_resource.snapshots.filter(OwnerIds=['self']) |
| Param( $AWSRegion = 'us-east-1', $AWSProfileName = 'default') | |
| # | |
| # Store your AWS credentials using the following Powershell AWS command: | |
| # | |
| # Set-AWSCredentials -AccessKey {xx} -SecretKey {xx} -StoreAs {MyProfileName} | |
| # | |
| # Example: | |
| # | |
| # Set-AWSCredentials -AccessKey 'AKIAVJL...KWJKOB4XN' -SecretKey 'oxLcrpnd3S+...1Y5eg3m92E8e2Me' -StoreAs 'testprofile' | |
| # Set-DefaultAWSRegion us-east-1 |