Skip to content

Commit

Permalink
Merge pull request #2 from xoap-io/dev
Browse files Browse the repository at this point in the history
fix: resolved merge conflicts
  • Loading branch information
ssokolic authored Apr 23, 2024
2 parents a3f8b09 + 27baff6 commit 8d92f11
Show file tree
Hide file tree
Showing 74 changed files with 588 additions and 312 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MIT License
# MIT License

Copyright (c) 2024 XOAP.io

Expand Down
22 changes: 15 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Introduction

This repository hosts scripts for the Scripted Actions area, which is part of the [XOAP platform](https://xoap.io). They are provided as-is and are not officially supported by XOAP. Use them at your own risk. Always test them in a non-production environment before using them in production.
This repository hosts scripts for the Scripted Actions area, which is part of
the [XOAP platform](https://xoap.io). They are provided as-is and are not
officially supported by XOAP. Use them at your own risk. Always test them in a
non-production environment before using them in production.

## Code of Conduct

Expand All @@ -14,19 +17,24 @@ A full list of changes in each version can be found in the [Releases](https://g

### Azure CLI & Bicep

Most of the available scripts are built to use a local Azure CLI configuration file. Find more information here: [Azure CLI Configuration](https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration).
Most of the available scripts are built to use a local Azure CLI configuration
file. Find more information here: [Azure CLI Configuration](https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration).

### Azure PowerShell

For Azure PowerShell-related scripts we suggest to use the noninteractive authentication with a service principal: [Sign in to Azure PowerShell with a service principal](https://learn.microsoft.com/en-us/powershell/azure/authenticate-noninteractive?view=azps-11.4.0).
For Azure PowerShell-related scripts we suggest using the noninteractive
authentication with a service principal:
[Sign in to Azure PowerShell with a service principal](https://learn.microsoft.com/en-us/powershell/azure/authenticate-noninteractive?view=azps-11.4.0).

### AWS CLI

For AWS CLI-related scripts we suggest using the AWS CLI configuration file: [Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).
For AWS CLI-related scripts we suggest using the AWS CLI configuration file:
[Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).

## Prerequisites

Depending on which scripts you want to use, you need to have the following prerequisites installed:
Depending on which scripts you want to use, you need to have the following
prerequisites installed:

### Azure CLI

Expand All @@ -50,5 +58,5 @@ See Azure CLI & Azure PowerShell.

## Templates

You can use the provided templates to create your scripts. The templates are located in the `templates` folder.

You can use the provided templates to create your scripts.
The templates are located in the `templates` folder.
6 changes: 3 additions & 3 deletions aws-cli/ec2/aws-cli-allocate-elastic-ip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsInstanceId,
[string]$AwsInstanceId = "myInstanceId",
[Parameter(Mandatory)]
[string]$AwsElasticIpId
[string]$AwsElasticIpId = "myElasticIpId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"


aws ec2 associate-address `
Expand Down
11 changes: 6 additions & 5 deletions aws-cli/ec2/aws-cli-create-ec2-instance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,20 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsAmiId,
[string]$AwsAmiId = "myAmiId",
[Parameter(Mandatory)]
[int]$AwsInstanceCount,
[int]$AwsInstanceCount = 1,
[Parameter(Mandatory)]
[ValidateSet('t2.micro', 't2.small', 't2.medium', 't2.large', 'm4.large', 'm4.xlarge', 'm4.2xlarge', 'm4.4xlarge', 'm4.10xlarge', 'm4.16xlarge', 'm5.large', 'm5.xlarge', 'm5.2xlarge', 'm5.4xlarge', 'm5.12xlarge', 'm5.24xlarge', 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', 'c4.large', 'c4.xlarge', 'c4.2xlarge', 'c4.4xlarge', 'c4.8xlarge', 'c5.large', 'c5.xlarge', 'c5.2xlarge', 'c5.4xlarge', 'c5.9xlarge', 'c5.18xlarge', 'c5d.large', 'c5d.xlarge', 'c5d.2xlarge', 'c5d.4xlarge', 'c5d.9xlarge', 'c5d.18xlarge', 'r4.large', 'r4.xlarge', 'r4.2xlarge', 'r4.4xlarge', 'r4.8xlarge', 'r4.16xlarge', 'r5.large', 'r5.xlarge', 'r5.2xlarge', 'r5.4xlarge', 'r5.12xlarge', 'r5.24xlarge', 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', 'i3.large', 'i3.xlarge', 'i3.2xlarge', 'i3.4xlarge', 'i3.8xlarge', 'i3.16xlarge', 'i3en.large', 'i3en.xlarge', 'i3en.2xlarge', 'i3en.3xlarge')]
[string]$AwsInstanceType,
[Parameter(Mandatory)]
[string]$AwsKeyPairName,
[string]$AwsKeyPairName = "myKeyPairName",
[Parameter(Mandatory)]
[string]$AwsSecurityGroupId
[string]$AwsSecurityGroupId = "mySecurityGroupId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"


aws ec2 run-instances `
Expand Down
4 changes: 2 additions & 2 deletions aws-cli/ec2/aws-cli-create-ec2-key-pair.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsKeyPairName
[string]$AwsKeyPairName = "myKeyPair"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws ec2 create-key-pair `
--key-name $AwsKeyPairName `
Expand Down
6 changes: 3 additions & 3 deletions aws-cli/ec2/aws-cli-start-instance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG
.COMPONENT
AWS CLI
.LINK
https://github.com/xoap-io/scripted-actions
Expand All @@ -31,11 +31,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsInstanceId
[string]$AwsInstanceId = "myInstanceId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"


aws ec2 start-instances `
Expand Down
4 changes: 2 additions & 2 deletions aws-cli/ec2/aws-cli-stop-instance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsInstanceId
[string]$AwsInstanceId = "myInstanceId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws ec2 stop-instances `
--instance-ids $AwsInstanceId
6 changes: 3 additions & 3 deletions aws-cli/ec2/aws-cli-terminate-instance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
PowerShell is a product of Microsoft Corporation. XOAP is a product of RIS AG. © RIS AG
.COMPONENT
AWS CLI
.LINK
https://github.com/xoap-io/scripted-actions
Expand All @@ -31,11 +31,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsInstanceId
[string]$AwsInstanceId = "myInstanceId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws ec2 terminate-instances `
--instance-ids $AwsInstanceId
10 changes: 5 additions & 5 deletions aws-cli/network/aws-cli-create-subnet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsVpcId,
[string]$AwsVpcId = "myVpcId",
[Parameter(Mandatory)]
[string]$AwsCidrBlock,
[string]$AwsCidrBlock = "myCidrBlock",
[Parameter(Mandatory)]
[string]$AwsIpv6CidrBlock,
[string]$AwsIpv6CidrBlock = "myIpv6CidrBlock",
[Parameter(Mandatory)]
[string]$AwsTagSpecifications
[string]$AwsTagSpecifications = "myTagSpecifications"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws ec2 create-subnet `
--vpc-id $AwsVpcId `
Expand Down
6 changes: 3 additions & 3 deletions aws-cli/organizations/aws-cli-create-account.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsAccountEmail,
[string]$AwsAccountEmail = "myEmail",
[Parameter(Mandatory)]
[string]$AwsAccountName
[string]$AwsAccountName = "myAccountName"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws organizations create-account `
--email $AwsAccountEmail `
Expand Down
10 changes: 5 additions & 5 deletions aws-cli/security/aws-cli-authorize-ec2-security-group
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsSecurityGroupId,
[string]$AwsSecurityGroupId = "sg-1234567890abcdef0",
[Parameter(Mandatory)]
[string]$AwsSecurityGroupProtocol,
[string]$AwsSecurityGroupProtocol = "tcp",
[Parameter(Mandatory)]
[string]$AwsSecurityGroupPort,
[string]$AwsSecurityGroupPort = "80",
[Parameter(Mandatory)]
[string]$AwsSecurityGroupCidr
[string]$AwsSecurityGroupCidr = "10.0.0.0/16"

)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws ec2 authorize-security-group-ingress `
--group-id $AwsSecurityGroupId `
Expand Down
4 changes: 2 additions & 2 deletions aws-cli/security/aws-cli-delete-ec2-security-group.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsSecurityGroupId
[string]$AwsSecurityGroupId = "mySecurityGroupId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws ec2 delete-security-group `
--group-id $AwsSecurityGroupId
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsSecurityGroupName,
[string]$AwsSecurityGroupName = "mySecurityGroup",
[Parameter(Mandatory)]
[string]$AwsSecurityGroupDescription,
[string]$AwsSecurityGroupDescription = "MySecurityGroupDescription",
[Parameter(Mandatory)]
[string]$AwsVpcId
[string]$AwsVpcId = "myVpcId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws ec2 create-security-group `
--group-name $AwsSecurityGroupName `
Expand Down
7 changes: 4 additions & 3 deletions aws-cli/storage/aws-cli-create-s3-bucket.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsBucketName,
[string]$AwsBucketName = "myBucketName",
[Parameter(Mandatory)]
[string]$AwsBucketRegion
[ValidateSet('af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-southeast-1','ap-southeast-2','ca-central-1','eu-central-1','eu-north-1','eu-south-1','eu-west-1','eu-west-2','eu-west-3','me-south-1','sa-east-1','us-east-1','us-east-2','us-west-1','us-west-2')]
[string]$AwsBucketRegion = "myBucketRegion"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws s3api create-bucket `
--bucket $AwsBucketName `
Expand Down
4 changes: 2 additions & 2 deletions aws-cli/workspaces/aws-cli-create-tag.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsWorkspaceId
[string]$AwsWorkspaceId = "myWorkspaceId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws workspaces create-tags `
--resource-id $AwsWorkspaceId `
Expand Down
4 changes: 2 additions & 2 deletions aws-cli/workspaces/aws-cli-delete-tag.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsWorkspaceId
[string]$AwsWorkspaceId = "myWorkspaceId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws workspaces delete-tags `
--resource-id $AwsWorkspaceId `
Expand Down
4 changes: 2 additions & 2 deletions aws-cli/workspaces/aws-cli-deregister-workspace-directory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsDirectoryId
[string]$AwsDirectoryId = "myDirectoryId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws workspaces deregister-workspace-directory `
--directory-id $AwsDirectoryId
6 changes: 3 additions & 3 deletions aws-cli/workspaces/aws-cli-migrate-workspace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsSourceWorkspaceId,
[string]$AwsSourceWorkspaceId = "myWorkspaceId",
[Parameter(Mandatory)]
[string]$AwsWorkspaceBundleId
[string]$AwsWorkspaceBundleId = "myWorkspaceBundleId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws workspaces migrate-workspace `
--source-workspace-id $AwsSourceWorkspaceId `
Expand Down
6 changes: 3 additions & 3 deletions aws-cli/workspaces/aws-cli-modify-workspace-state.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsWorkspaceId,
[string]$AwsWorkspaceId = "myWorkspaceId",
[Parameter(Mandatory)]
[string]$AWsWorkspaceState
[string]$AWsWorkspaceState = "myWorkspaceState"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws workspaces modify-workspace-state `
--workspace-id $AwsWorkspaceId `
Expand Down
4 changes: 2 additions & 2 deletions aws-cli/workspaces/aws-cli-reboot-workspace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsWorkspaceId
[string]$AwsWorkspaceId = "myWorkspaceId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws workspaces reboot-workspaces `
--reboot-workspace-requests $AwsWorkspaceId
4 changes: 2 additions & 2 deletions aws-cli/workspaces/aws-cli-rebuild-workspace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$AwsWorkspaceId
[string]$AwsWorkspaceId = "myWorkspaceId"
)

#Set Error Action to Silently Continue
$ErrorActionPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"

aws workspaces rebuild-workspaces `
--rebuild-workspace-requests $AwsWorkspaceId
Loading

0 comments on commit 8d92f11

Please sign in to comment.