AWSをお使いの皆さん、AWS Tools for Windows PowerShell使ってますか?
Windows環境でAWS環境を管理するに当たっては、 AWSから以下が提供されています。
- Web上のAWS Management Console
- Vistual StudioへのAWS Toolkit for Microsoft Visual Studio拡張機能追加
- AWS Tools for Windows PowerShellでのPowerShellによる管理
Web上のAWS Management Consoleも日々進化を遂げていて使いやすいことは使いやすいのですが、動作がもっさりしていてストレスが貯まって仕方ありません。
実は、AWS Toolkit for Microsoft Visual StudioによるVisual StudioからのAWSリソースの管理もWeb上のManagement Consoleと同程度に機能があるうえ、動作も快適なのでおすすめです。 AWS Toolkit for Microsoft Visual StudioはVisual Studio 2012 Update 3でも動作を確認しています。
AWS Toolkit for Microsoft Visual Studio のダウンロードは、こちらからどうぞ。
しかし、GUIは大量インスタンスの管理には向いていません。例えば10台、50台、100台、とインスタンスが増えていった時にGUIでポチポチ操作したい人はいないでしょう。 AWSリソース管理がAWS Tools for Windows PowerShellによって可能になりました。
AWS Tools for Windows PowerShellのダウンロードはこちらからどうぞ。
大量インスタンスへの柔軟な絞り込み、操作の適用に、是非Powershellを活用できます。私はその恩恵に最大限あずかっています。 今回は、インストールから認証までのサンプルをやってみましょう。
ダウンロードとインストール
先のページからダウンロードします。 2013/7/20現在は、 5.3.0が最新ですね。頻繁に更新されるので、随時確認をおすすめします。
- ダウンロードしたら実行
- ライセンスに同意
- インストールする機能を選択
- インストール開始/完了
※ もしPowerShell ISEを開いている場合は、閉じるように指示されます。
インストールしたらコマンドレットを確認してみましょう。735件も出てきます。
Get-Command -Module AWSPowerShell
ちょっと分類別に出しましょう。
$services = @( "as", # AutoScaling "cf[a-mo-z]", # AWS CloudFront "cfn", # AWS CloudFormation "cs[a-uw-z]", # Amazon CloudSearch "cw", # Amazon CloudWatch "eb", # AWS Elastic Beanstalk "ec2", # Amazon EC2 "ec", # Amazon ElastiCache "elb", # Elastic Load Balancing "emr", # Amazon Elastic Map Reduce "iam", # AWS Identity and Access Management "ie", # AWS Import/Export "r53", # Amazon Route 53 "rds", # Amazon RDS "s3", # Amazon S3 "sg", # Amazon Storage Gateway "ses", # Amazon SES "sns", # Amazon SNS "sqs", # Amazon SQS "sts" # AWS STS ) foreach ($s in $services ) { "------" Get-Command -noun ${s}* } CommandType Name ModuleName ----------- ---- ---------- Function Invoke-AsWorkflow PSWorkflowUtility Cmdlet Add-ASACommunicationToCase AWSPowerShell Cmdlet Disable-ASMetricsCollection AWSPowerShell Cmdlet Enable-ASMetricsCollection AWSPowerShell Cmdlet Get-ASACases AWSPowerShell Cmdlet Get-ASACommunications AWSPowerShell Cmdlet Get-ASAdjustmentType AWSPowerShell Cmdlet Get-ASAServices AWSPowerShell Cmdlet Get-ASASeverityLevels AWSPowerShell Cmdlet Get-ASATrustedAdvisorCheckRefreshStatuses AWSPowerShell Cmdlet Get-ASATrustedAdvisorCheckResult AWSPowerShell Cmdlet Get-ASATrustedAdvisorChecks AWSPowerShell Cmdlet Get-ASATrustedAdvisorCheckSummaries AWSPowerShell Cmdlet Get-ASAutoScalingGroup AWSPowerShell Cmdlet Get-ASAutoScalingInstance AWSPowerShell Cmdlet Get-ASAutoScalingNotificationType AWSPowerShell Cmdlet Get-ASLaunchConfiguration AWSPowerShell Cmdlet Get-ASMetricCollectionType AWSPowerShell Cmdlet Get-ASNotificationConfiguration AWSPowerShell Cmdlet Get-ASPolicy AWSPowerShell Cmdlet Get-ASScalingActivity AWSPowerShell Cmdlet Get-ASScalingProcessType AWSPowerShell Cmdlet Get-ASScheduledAction AWSPowerShell Cmdlet Get-ASTag AWSPowerShell Cmdlet Get-ASTerminationPolicyType AWSPowerShell Cmdlet New-ASACase AWSPowerShell Cmdlet New-ASAutoScalingGroup AWSPowerShell Cmdlet New-ASLaunchConfiguration AWSPowerShell Cmdlet Remove-ASAutoScalingGroup AWSPowerShell Cmdlet Remove-ASLaunchConfiguration AWSPowerShell Cmdlet Remove-ASNotificationConfiguration AWSPowerShell Cmdlet Remove-ASPolicy AWSPowerShell Cmdlet Remove-ASScheduledAction AWSPowerShell Cmdlet Remove-ASTag AWSPowerShell Cmdlet Request-ASATrustedAdvisorCheckRefresh AWSPowerShell Cmdlet Resolve-ASACase AWSPowerShell Cmdlet Resume-ASProcess AWSPowerShell Cmdlet Set-ASDesiredCapacity AWSPowerShell Cmdlet Set-ASInstanceHealth AWSPowerShell Cmdlet Set-ASTag AWSPowerShell Cmdlet Start-ASPolicy AWSPowerShell Cmdlet Stop-ASInstanceInAutoScalingGroup AWSPowerShell Cmdlet Suspend-ASProcess AWSPowerShell Cmdlet Update-ASAutoScalingGroup AWSPowerShell Cmdlet Write-ASNotificationConfiguration AWSPowerShell Cmdlet Write-ASScalingPolicy AWSPowerShell Cmdlet Write-ASScheduledUpdateGroupAction AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Get-CFCloudFrontOriginAccessIdentities AWSPowerShell Cmdlet Get-CFCloudFrontOriginAccessIdentity AWSPowerShell Cmdlet Get-CFCloudFrontOriginAccessIdentityConfig AWSPowerShell Cmdlet Get-CFDistribution AWSPowerShell Cmdlet Get-CFDistributionConfig AWSPowerShell Cmdlet Get-CFDistributions AWSPowerShell Cmdlet Get-CFInvalidation AWSPowerShell Cmdlet Get-CFInvalidations AWSPowerShell Cmdlet Get-CFStreamingDistribution AWSPowerShell Cmdlet Get-CFStreamingDistributionConfig AWSPowerShell Cmdlet Get-CFStreamingDistributions AWSPowerShell Cmdlet New-CFCloudFrontOriginAccessIdentity AWSPowerShell Cmdlet New-CFDistribution AWSPowerShell Cmdlet New-CFInvalidation AWSPowerShell Cmdlet New-CFStreamingDistribution AWSPowerShell Cmdlet Remove-CFCloudFrontOriginAccessIdentity AWSPowerShell Cmdlet Remove-CFDistribution AWSPowerShell Cmdlet Remove-CFStreamingDistribution AWSPowerShell Cmdlet Update-CFCloudFrontOriginAccessIdentity AWSPowerShell Cmdlet Update-CFDistribution AWSPowerShell Cmdlet Update-CFStreamingDistribution AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Get-CFNStack AWSPowerShell Cmdlet Get-CFNStackEvent AWSPowerShell Cmdlet Get-CFNStackResource AWSPowerShell Cmdlet Get-CFNStackResources AWSPowerShell Cmdlet Get-CFNStackResourceSummary AWSPowerShell Cmdlet Get-CFNStackSummary AWSPowerShell Cmdlet Get-CFNTemplate AWSPowerShell Cmdlet Measure-CFNTemplateCost AWSPowerShell Cmdlet New-CFNStack AWSPowerShell Cmdlet Remove-CFNStack AWSPowerShell Cmdlet Test-CFNTemplate AWSPowerShell Cmdlet Update-CFNStack AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Get-CSDefaultSearchField AWSPowerShell Cmdlet Get-CSDomain AWSPowerShell Cmdlet Get-CSIndexField AWSPowerShell Cmdlet Get-CSRankExpression AWSPowerShell Cmdlet Get-CSServiceAccessPolicy AWSPowerShell Cmdlet Get-CSStemmingOption AWSPowerShell Cmdlet Get-CSStopwordOption AWSPowerShell Cmdlet Get-CSSynonymOption AWSPowerShell Cmdlet New-CSDomain AWSPowerShell Cmdlet Remove-CSDomain AWSPowerShell Cmdlet Remove-CSIndexField AWSPowerShell Cmdlet Remove-CSRankExpression AWSPowerShell Cmdlet Set-CSIndexField AWSPowerShell Cmdlet Set-CSRankExpression AWSPowerShell Cmdlet Start-CSIndex AWSPowerShell Cmdlet Update-CSDefaultSearchField AWSPowerShell Cmdlet Update-CSServiceAccessPolicy AWSPowerShell Cmdlet Update-CSStemmingOption AWSPowerShell Cmdlet Update-CSStopwordOption AWSPowerShell Cmdlet Update-CSSynonymOption AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Disable-CWAlarmAction AWSPowerShell Cmdlet Enable-CWAlarmAction AWSPowerShell Cmdlet Get-CWAlarm AWSPowerShell Cmdlet Get-CWAlarmForMetric AWSPowerShell Cmdlet Get-CWAlarmHistory AWSPowerShell Cmdlet Get-CWMetrics AWSPowerShell Cmdlet Get-CWMetricStatistics AWSPowerShell Cmdlet Remove-CWAlarm AWSPowerShell Cmdlet Set-CWAlarmState AWSPowerShell Cmdlet Write-CWMetricAlarm AWSPowerShell Cmdlet Write-CWMetricData AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Get-EBApplication AWSPowerShell Cmdlet Get-EBApplicationVersion AWSPowerShell Cmdlet Get-EBAvailableSolutionStack AWSPowerShell Cmdlet Get-EBConfigurationOption AWSPowerShell Cmdlet Get-EBConfigurationSetting AWSPowerShell Cmdlet Get-EBDNSAvailability AWSPowerShell Cmdlet Get-EBEnvironment AWSPowerShell Cmdlet Get-EBEnvironmentInfo AWSPowerShell Cmdlet Get-EBEnvironmentResource AWSPowerShell Cmdlet Get-EBEvent AWSPowerShell Cmdlet New-EBApplication AWSPowerShell Cmdlet New-EBApplicationVersion AWSPowerShell Cmdlet New-EBConfigurationTemplate AWSPowerShell Cmdlet New-EBEnvironment AWSPowerShell Cmdlet New-EBStorageLocation AWSPowerShell Cmdlet Remove-EBApplication AWSPowerShell Cmdlet Remove-EBApplicationVersion AWSPowerShell Cmdlet Remove-EBConfigurationTemplate AWSPowerShell Cmdlet Remove-EBEnvironmentConfiguration AWSPowerShell Cmdlet Request-EBEnvironmentInfo AWSPowerShell Cmdlet Restart-EBAppServer AWSPowerShell Cmdlet Set-EBEnvironmentCNAME AWSPowerShell Cmdlet Start-EBEnvironmentRebuild AWSPowerShell Cmdlet Stop-EBEnvironment AWSPowerShell Cmdlet Test-EBConfigurationSetting AWSPowerShell Cmdlet Update-EBApplication AWSPowerShell Cmdlet Update-EBApplicationVersion AWSPowerShell Cmdlet Update-EBConfigurationTemplate AWSPowerShell Cmdlet Update-EBEnvironment AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Function Get-EC2InstancesWithTag PS-AWSConnection Cmdlet Add-EC2InternetGateway AWSPowerShell Cmdlet Add-EC2NetworkInterface AWSPowerShell Cmdlet Add-EC2Volume AWSPowerShell Cmdlet Add-EC2VpnGateway AWSPowerShell Cmdlet Confirm-EC2ProductInstance AWSPowerShell Cmdlet Copy-EC2Image AWSPowerShell Cmdlet Copy-EC2Snapshot AWSPowerShell Cmdlet Disable-EC2License AWSPowerShell Cmdlet Disable-EC2VGWRoutePropagation AWSPowerShell Cmdlet Dismount-EC2InternetGateway AWSPowerShell Cmdlet Dismount-EC2NetworkInterface AWSPowerShell Cmdlet Dismount-EC2Volume AWSPowerShell Cmdlet Dismount-EC2VpnGateway AWSPowerShell Cmdlet Edit-EC2ImageAttribute AWSPowerShell Cmdlet Edit-EC2InstanceAttribute AWSPowerShell Cmdlet Edit-EC2NetworkInterfaceAttribute AWSPowerShell Cmdlet Edit-EC2SnapshotAttribute AWSPowerShell Cmdlet Edit-EC2VolumeAttribute AWSPowerShell Cmdlet Edit-EC2VpcAttribute AWSPowerShell Cmdlet Enable-EC2License AWSPowerShell Cmdlet Enable-EC2VGWRoutePropagation AWSPowerShell Cmdlet Enable-EC2VolumeIO AWSPowerShell Cmdlet Get-EC2AccountAttributes AWSPowerShell Cmdlet Get-EC2Address AWSPowerShell Cmdlet Get-EC2AvailabilityZone AWSPowerShell Cmdlet Get-EC2BundleTask AWSPowerShell Cmdlet Get-EC2ConsoleOutput AWSPowerShell Cmdlet Get-EC2ConversionTask AWSPowerShell Cmdlet Get-EC2CustomerGateway AWSPowerShell Cmdlet Get-EC2DhcpOption AWSPowerShell Cmdlet Get-EC2Image AWSPowerShell Cmdlet Get-EC2ImageAttribute AWSPowerShell Cmdlet Get-EC2ImageByName AWSPowerShell Cmdlet Get-EC2Instance AWSPowerShell Cmdlet Get-EC2InstanceAttribute AWSPowerShell Cmdlet Get-EC2InstanceStatus AWSPowerShell Cmdlet Get-EC2InternetGateway AWSPowerShell Cmdlet Get-EC2KeyPair AWSPowerShell Cmdlet Get-EC2License AWSPowerShell Cmdlet Get-EC2NetworkAcl AWSPowerShell Cmdlet Get-EC2NetworkInterface AWSPowerShell Cmdlet Get-EC2NetworkInterfaceAttribute AWSPowerShell Cmdlet Get-EC2PasswordData AWSPowerShell Cmdlet Get-EC2PlacementGroup AWSPowerShell Cmdlet Get-EC2Region AWSPowerShell Cmdlet Get-EC2ReservedInstance AWSPowerShell Cmdlet Get-EC2ReservedInstancesListing AWSPowerShell Cmdlet Get-EC2ReservedInstancesOffering AWSPowerShell Cmdlet Get-EC2RouteTable AWSPowerShell Cmdlet Get-EC2SecurityGroup AWSPowerShell Cmdlet Get-EC2Snapshot AWSPowerShell Cmdlet Get-EC2SnapshotAttribute AWSPowerShell Cmdlet Get-EC2SpotDatafeedSubscription AWSPowerShell Cmdlet Get-EC2SpotInstanceRequest AWSPowerShell Cmdlet Get-EC2SpotPriceHistory AWSPowerShell Cmdlet Get-EC2Subnet AWSPowerShell Cmdlet Get-EC2Tag AWSPowerShell Cmdlet Get-EC2Volume AWSPowerShell Cmdlet Get-EC2VolumeAttribute AWSPowerShell Cmdlet Get-EC2VolumeStatus AWSPowerShell Cmdlet Get-EC2Vpc AWSPowerShell Cmdlet Get-EC2VpcAttribute AWSPowerShell Cmdlet Get-EC2VpnConnection AWSPowerShell Cmdlet Get-EC2VpnGateway AWSPowerShell Cmdlet Grant-EC2SecurityGroupEgress AWSPowerShell Cmdlet Grant-EC2SecurityGroupIngress AWSPowerShell Cmdlet Import-EC2Instance AWSPowerShell Cmdlet Import-EC2KeyPair AWSPowerShell Cmdlet Import-EC2Volume AWSPowerShell Cmdlet New-EC2Address AWSPowerShell Cmdlet New-EC2CustomerGateway AWSPowerShell Cmdlet New-EC2DhcpOption AWSPowerShell Cmdlet New-EC2Image AWSPowerShell Cmdlet New-EC2Instance AWSPowerShell Cmdlet New-EC2InstanceBundle AWSPowerShell Cmdlet New-EC2InternetGateway AWSPowerShell Cmdlet New-EC2KeyPair AWSPowerShell Cmdlet New-EC2NetworkAcl AWSPowerShell Cmdlet New-EC2NetworkAclEntry AWSPowerShell Cmdlet New-EC2NetworkInterface AWSPowerShell Cmdlet New-EC2PlacementGroup AWSPowerShell Cmdlet New-EC2ReservedInstance AWSPowerShell Cmdlet New-EC2ReservedInstancesListing AWSPowerShell Cmdlet New-EC2Route AWSPowerShell Cmdlet New-EC2RouteTable AWSPowerShell Cmdlet New-EC2SecurityGroup AWSPowerShell Cmdlet New-EC2Snapshot AWSPowerShell Cmdlet New-EC2SpotDatafeedSubscription AWSPowerShell Cmdlet New-EC2Subnet AWSPowerShell Cmdlet New-EC2Tag AWSPowerShell Cmdlet New-EC2Volume AWSPowerShell Cmdlet New-EC2Vpc AWSPowerShell Cmdlet New-EC2VpnConnection AWSPowerShell Cmdlet New-EC2VpnConnectionRoute AWSPowerShell Cmdlet New-EC2VpnGateway AWSPowerShell Cmdlet Register-EC2Address AWSPowerShell Cmdlet Register-EC2DhcpOption AWSPowerShell Cmdlet Register-EC2Image AWSPowerShell Cmdlet Register-EC2PrivateIpAddress AWSPowerShell Cmdlet Register-EC2RouteTable AWSPowerShell Cmdlet Remove-EC2Address AWSPowerShell Cmdlet Remove-EC2CustomerGateway AWSPowerShell Cmdlet Remove-EC2DhcpOption AWSPowerShell Cmdlet Remove-EC2InternetGateway AWSPowerShell Cmdlet Remove-EC2KeyPair AWSPowerShell Cmdlet Remove-EC2NetworkAcl AWSPowerShell Cmdlet Remove-EC2NetworkAclEntry AWSPowerShell Cmdlet Remove-EC2NetworkInterface AWSPowerShell Cmdlet Remove-EC2PlacementGroup AWSPowerShell Cmdlet Remove-EC2Route AWSPowerShell Cmdlet Remove-EC2RouteTable AWSPowerShell Cmdlet Remove-EC2SecurityGroup AWSPowerShell Cmdlet Remove-EC2Snapshot AWSPowerShell Cmdlet Remove-EC2SpotDatafeedSubscription AWSPowerShell Cmdlet Remove-EC2Subnet AWSPowerShell Cmdlet Remove-EC2Tag AWSPowerShell Cmdlet Remove-EC2Volume AWSPowerShell Cmdlet Remove-EC2Vpc AWSPowerShell Cmdlet Remove-EC2VpnConnection AWSPowerShell Cmdlet Remove-EC2VpnConnectionRoute AWSPowerShell Cmdlet Remove-EC2VpnGateway AWSPowerShell Cmdlet Request-EC2SpotInstance AWSPowerShell Cmdlet Reset-EC2ImageAttribute AWSPowerShell Cmdlet Reset-EC2InstanceAttribute AWSPowerShell Cmdlet Reset-EC2NetworkInterfaceAttribute AWSPowerShell Cmdlet Reset-EC2SnapshotAttribute AWSPowerShell Cmdlet Restart-EC2Instance AWSPowerShell Cmdlet Revoke-EC2SecurityGroupEgress AWSPowerShell Cmdlet Revoke-EC2SecurityGroupIngress AWSPowerShell Cmdlet Send-EC2InstanceStatus AWSPowerShell Cmdlet Set-EC2NetworkAclAssociation AWSPowerShell Cmdlet Set-EC2NetworkAclEntry AWSPowerShell Cmdlet Set-EC2Route AWSPowerShell Cmdlet Set-EC2RouteTableAssociation AWSPowerShell Cmdlet Start-EC2Instance AWSPowerShell Cmdlet Start-EC2InstanceMonitoring AWSPowerShell Cmdlet Stop-EC2BundleTask AWSPowerShell Cmdlet Stop-EC2ConversionTask AWSPowerShell Cmdlet Stop-EC2Instance AWSPowerShell Cmdlet Stop-EC2InstanceMonitoring AWSPowerShell Cmdlet Stop-EC2ReservedInstancesListing AWSPowerShell Cmdlet Stop-EC2SpotInstanceRequest AWSPowerShell Cmdlet Unregister-EC2Address AWSPowerShell Cmdlet Unregister-EC2Image AWSPowerShell Cmdlet Unregister-EC2PrivateIpAddress AWSPowerShell Cmdlet Unregister-EC2RouteTable AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Function Get-EC2InstancesWithTag PS-AWSConnection Cmdlet Add-EC2InternetGateway AWSPowerShell Cmdlet Add-EC2NetworkInterface AWSPowerShell Cmdlet Add-EC2Volume AWSPowerShell Cmdlet Add-EC2VpnGateway AWSPowerShell Cmdlet Approve-ECCacheSecurityGroupIngress AWSPowerShell Cmdlet Confirm-EC2ProductInstance AWSPowerShell Cmdlet Copy-EC2Image AWSPowerShell Cmdlet Copy-EC2Snapshot AWSPowerShell Cmdlet Disable-EC2License AWSPowerShell Cmdlet Disable-EC2VGWRoutePropagation AWSPowerShell Cmdlet Dismount-EC2InternetGateway AWSPowerShell Cmdlet Dismount-EC2NetworkInterface AWSPowerShell Cmdlet Dismount-EC2Volume AWSPowerShell Cmdlet Dismount-EC2VpnGateway AWSPowerShell Cmdlet Edit-EC2ImageAttribute AWSPowerShell Cmdlet Edit-EC2InstanceAttribute AWSPowerShell Cmdlet Edit-EC2NetworkInterfaceAttribute AWSPowerShell Cmdlet Edit-EC2SnapshotAttribute AWSPowerShell Cmdlet Edit-EC2VolumeAttribute AWSPowerShell Cmdlet Edit-EC2VpcAttribute AWSPowerShell Cmdlet Edit-ECCacheCluster AWSPowerShell Cmdlet Edit-ECCacheParameterGroup AWSPowerShell Cmdlet Edit-ECCacheSubnetGroup AWSPowerShell Cmdlet Enable-EC2License AWSPowerShell Cmdlet Enable-EC2VGWRoutePropagation AWSPowerShell Cmdlet Enable-EC2VolumeIO AWSPowerShell Cmdlet Get-EC2AccountAttributes AWSPowerShell Cmdlet Get-EC2Address AWSPowerShell Cmdlet Get-EC2AvailabilityZone AWSPowerShell Cmdlet Get-EC2BundleTask AWSPowerShell Cmdlet Get-EC2ConsoleOutput AWSPowerShell Cmdlet Get-EC2ConversionTask AWSPowerShell Cmdlet Get-EC2CustomerGateway AWSPowerShell Cmdlet Get-EC2DhcpOption AWSPowerShell Cmdlet Get-EC2Image AWSPowerShell Cmdlet Get-EC2ImageAttribute AWSPowerShell Cmdlet Get-EC2ImageByName AWSPowerShell Cmdlet Get-EC2Instance AWSPowerShell Cmdlet Get-EC2InstanceAttribute AWSPowerShell Cmdlet Get-EC2InstanceStatus AWSPowerShell Cmdlet Get-EC2InternetGateway AWSPowerShell Cmdlet Get-EC2KeyPair AWSPowerShell Cmdlet Get-EC2License AWSPowerShell Cmdlet Get-EC2NetworkAcl AWSPowerShell Cmdlet Get-EC2NetworkInterface AWSPowerShell Cmdlet Get-EC2NetworkInterfaceAttribute AWSPowerShell Cmdlet Get-EC2PasswordData AWSPowerShell Cmdlet Get-EC2PlacementGroup AWSPowerShell Cmdlet Get-EC2Region AWSPowerShell Cmdlet Get-EC2ReservedInstance AWSPowerShell Cmdlet Get-EC2ReservedInstancesListing AWSPowerShell Cmdlet Get-EC2ReservedInstancesOffering AWSPowerShell Cmdlet Get-EC2RouteTable AWSPowerShell Cmdlet Get-EC2SecurityGroup AWSPowerShell Cmdlet Get-EC2Snapshot AWSPowerShell Cmdlet Get-EC2SnapshotAttribute AWSPowerShell Cmdlet Get-EC2SpotDatafeedSubscription AWSPowerShell Cmdlet Get-EC2SpotInstanceRequest AWSPowerShell Cmdlet Get-EC2SpotPriceHistory AWSPowerShell Cmdlet Get-EC2Subnet AWSPowerShell Cmdlet Get-EC2Tag AWSPowerShell Cmdlet Get-EC2Volume AWSPowerShell Cmdlet Get-EC2VolumeAttribute AWSPowerShell Cmdlet Get-EC2VolumeStatus AWSPowerShell Cmdlet Get-EC2Vpc AWSPowerShell Cmdlet Get-EC2VpcAttribute AWSPowerShell Cmdlet Get-EC2VpnConnection AWSPowerShell Cmdlet Get-EC2VpnGateway AWSPowerShell Cmdlet Get-ECCacheCluster AWSPowerShell Cmdlet Get-ECCacheEngineVersions AWSPowerShell Cmdlet Get-ECCacheParameter AWSPowerShell Cmdlet Get-ECCacheParameterGroup AWSPowerShell Cmdlet Get-ECCacheSecurityGroup AWSPowerShell Cmdlet Get-ECCacheSubnetGroups AWSPowerShell Cmdlet Get-ECEngineDefaultParameter AWSPowerShell Cmdlet Get-ECEvent AWSPowerShell Cmdlet Get-ECReservedCacheNode AWSPowerShell Cmdlet Get-ECReservedCacheNodesOffering AWSPowerShell Cmdlet Grant-EC2SecurityGroupEgress AWSPowerShell Cmdlet Grant-EC2SecurityGroupIngress AWSPowerShell Cmdlet Import-EC2Instance AWSPowerShell Cmdlet Import-EC2KeyPair AWSPowerShell Cmdlet Import-EC2Volume AWSPowerShell Cmdlet New-EC2Address AWSPowerShell Cmdlet New-EC2CustomerGateway AWSPowerShell Cmdlet New-EC2DhcpOption AWSPowerShell Cmdlet New-EC2Image AWSPowerShell Cmdlet New-EC2Instance AWSPowerShell Cmdlet New-EC2InstanceBundle AWSPowerShell Cmdlet New-EC2InternetGateway AWSPowerShell Cmdlet New-EC2KeyPair AWSPowerShell Cmdlet New-EC2NetworkAcl AWSPowerShell Cmdlet New-EC2NetworkAclEntry AWSPowerShell Cmdlet New-EC2NetworkInterface AWSPowerShell Cmdlet New-EC2PlacementGroup AWSPowerShell Cmdlet New-EC2ReservedInstance AWSPowerShell Cmdlet New-EC2ReservedInstancesListing AWSPowerShell Cmdlet New-EC2Route AWSPowerShell Cmdlet New-EC2RouteTable AWSPowerShell Cmdlet New-EC2SecurityGroup AWSPowerShell Cmdlet New-EC2Snapshot AWSPowerShell Cmdlet New-EC2SpotDatafeedSubscription AWSPowerShell Cmdlet New-EC2Subnet AWSPowerShell Cmdlet New-EC2Tag AWSPowerShell Cmdlet New-EC2Volume AWSPowerShell Cmdlet New-EC2Vpc AWSPowerShell Cmdlet New-EC2VpnConnection AWSPowerShell Cmdlet New-EC2VpnConnectionRoute AWSPowerShell Cmdlet New-EC2VpnGateway AWSPowerShell Cmdlet New-ECCacheCluster AWSPowerShell Cmdlet New-ECCacheParameterGroup AWSPowerShell Cmdlet New-ECCacheSecurityGroup AWSPowerShell Cmdlet New-ECCacheSubnetGroup AWSPowerShell Cmdlet Register-EC2Address AWSPowerShell Cmdlet Register-EC2DhcpOption AWSPowerShell Cmdlet Register-EC2Image AWSPowerShell Cmdlet Register-EC2PrivateIpAddress AWSPowerShell Cmdlet Register-EC2RouteTable AWSPowerShell Cmdlet Remove-EC2Address AWSPowerShell Cmdlet Remove-EC2CustomerGateway AWSPowerShell Cmdlet Remove-EC2DhcpOption AWSPowerShell Cmdlet Remove-EC2InternetGateway AWSPowerShell Cmdlet Remove-EC2KeyPair AWSPowerShell Cmdlet Remove-EC2NetworkAcl AWSPowerShell Cmdlet Remove-EC2NetworkAclEntry AWSPowerShell Cmdlet Remove-EC2NetworkInterface AWSPowerShell Cmdlet Remove-EC2PlacementGroup AWSPowerShell Cmdlet Remove-EC2Route AWSPowerShell Cmdlet Remove-EC2RouteTable AWSPowerShell Cmdlet Remove-EC2SecurityGroup AWSPowerShell Cmdlet Remove-EC2Snapshot AWSPowerShell Cmdlet Remove-EC2SpotDatafeedSubscription AWSPowerShell Cmdlet Remove-EC2Subnet AWSPowerShell Cmdlet Remove-EC2Tag AWSPowerShell Cmdlet Remove-EC2Volume AWSPowerShell Cmdlet Remove-EC2Vpc AWSPowerShell Cmdlet Remove-EC2VpnConnection AWSPowerShell Cmdlet Remove-EC2VpnConnectionRoute AWSPowerShell Cmdlet Remove-EC2VpnGateway AWSPowerShell Cmdlet Remove-ECCacheCluster AWSPowerShell Cmdlet Remove-ECCacheParameterGroup AWSPowerShell Cmdlet Remove-ECCacheSecurityGroup AWSPowerShell Cmdlet Remove-ECCacheSubnetGroup AWSPowerShell Cmdlet Request-EC2SpotInstance AWSPowerShell Cmdlet Request-ECReservedCacheNodesOffering AWSPowerShell Cmdlet Reset-EC2ImageAttribute AWSPowerShell Cmdlet Reset-EC2InstanceAttribute AWSPowerShell Cmdlet Reset-EC2NetworkInterfaceAttribute AWSPowerShell Cmdlet Reset-EC2SnapshotAttribute AWSPowerShell Cmdlet Reset-ECCacheParameterGroup AWSPowerShell Cmdlet Restart-EC2Instance AWSPowerShell Cmdlet Restart-ECCacheCluster AWSPowerShell Cmdlet Revoke-EC2SecurityGroupEgress AWSPowerShell Cmdlet Revoke-EC2SecurityGroupIngress AWSPowerShell Cmdlet Revoke-ECCacheSecurityGroupIngress AWSPowerShell Cmdlet Send-EC2InstanceStatus AWSPowerShell Cmdlet Set-EC2NetworkAclAssociation AWSPowerShell Cmdlet Set-EC2NetworkAclEntry AWSPowerShell Cmdlet Set-EC2Route AWSPowerShell Cmdlet Set-EC2RouteTableAssociation AWSPowerShell Cmdlet Start-EC2Instance AWSPowerShell Cmdlet Start-EC2InstanceMonitoring AWSPowerShell Cmdlet Stop-EC2BundleTask AWSPowerShell Cmdlet Stop-EC2ConversionTask AWSPowerShell Cmdlet Stop-EC2Instance AWSPowerShell Cmdlet Stop-EC2InstanceMonitoring AWSPowerShell Cmdlet Stop-EC2ReservedInstancesListing AWSPowerShell Cmdlet Stop-EC2SpotInstanceRequest AWSPowerShell Cmdlet Unregister-EC2Address AWSPowerShell Cmdlet Unregister-EC2Image AWSPowerShell Cmdlet Unregister-EC2PrivateIpAddress AWSPowerShell Cmdlet Unregister-EC2RouteTable AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Function Get-ELBLoadBalancerInstanceId PS-AWSConnection Function Get-ELBLoadBalancerInstanceMatchRunningInstance PS-AWSConnection Function Start-ELBLoadBalancerInstanceMatchRunningEC2 PS-AWSConnection Function Stop-ELBLoadBalancerInstanceMatchRunningEC2 PS-AWSConnection Cmdlet Add-ELBLoadBalancerToSubnet AWSPowerShell Cmdlet Disable-ELBAvailabilityZoneForLoadBalancer AWSPowerShell Cmdlet Dismount-ELBLoadBalancerFromSubnet AWSPowerShell Cmdlet Enable-ELBAvailabilityZoneForLoadBalancer AWSPowerShell Cmdlet Get-ELBInstanceHealth AWSPowerShell Cmdlet Get-ELBLoadBalancer AWSPowerShell Cmdlet Get-ELBLoadBalancerPolicy AWSPowerShell Cmdlet Get-ELBLoadBalancerPolicyType AWSPowerShell Cmdlet Join-ELBSecurityGroupToLoadBalancer AWSPowerShell Cmdlet New-ELBAppCookieStickinessPolicy AWSPowerShell Cmdlet New-ELBLBCookieStickinessPolicy AWSPowerShell Cmdlet New-ELBLoadBalancer AWSPowerShell Cmdlet New-ELBLoadBalancerListener AWSPowerShell Cmdlet New-ELBLoadBalancerPolicy AWSPowerShell Cmdlet Register-ELBInstanceWithLoadBalancer AWSPowerShell Cmdlet Remove-ELBInstanceFromLoadBalancer AWSPowerShell Cmdlet Remove-ELBLoadBalancer AWSPowerShell Cmdlet Remove-ELBLoadBalancerListener AWSPowerShell Cmdlet Remove-ELBLoadBalancerPolicy AWSPowerShell Cmdlet Set-ELBHealthCheck AWSPowerShell Cmdlet Set-ELBLoadBalancerListenerSSLCertificate AWSPowerShell Cmdlet Set-ELBLoadBalancerPolicyForBackendServer AWSPowerShell Cmdlet Set-ELBLoadBalancerPolicyOfListener AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Add-EMRInstanceGroup AWSPowerShell Cmdlet Add-EMRJobFlowStep AWSPowerShell Cmdlet Edit-EMRInstanceGroup AWSPowerShell Cmdlet Get-EMRJobFlow AWSPowerShell Cmdlet Set-EMRTerminationProtection AWSPowerShell Cmdlet Set-EMRVisibleToAllUsers AWSPowerShell Cmdlet Start-EMRJobFlow AWSPowerShell Cmdlet Stop-EMRJobFlow AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Add-IAMRoleToInstanceProfile AWSPowerShell Cmdlet Add-IAMUserToGroup AWSPowerShell Cmdlet Disable-IAMMFADevice AWSPowerShell Cmdlet Edit-IAMPassword AWSPowerShell Cmdlet Enable-IAMMFADevice AWSPowerShell Cmdlet Get-IAMAccessKey AWSPowerShell Cmdlet Get-IAMAccountAlias AWSPowerShell Cmdlet Get-IAMAccountPasswordPolicy AWSPowerShell Cmdlet Get-IAMAccountSummary AWSPowerShell Cmdlet Get-IAMGroup AWSPowerShell Cmdlet Get-IAMGroupForUser AWSPowerShell Cmdlet Get-IAMGroupPolicies AWSPowerShell Cmdlet Get-IAMGroupPolicy AWSPowerShell Cmdlet Get-IAMGroups AWSPowerShell Cmdlet Get-IAMInstanceProfile AWSPowerShell Cmdlet Get-IAMInstanceProfileForRole AWSPowerShell Cmdlet Get-IAMInstanceProfiles AWSPowerShell Cmdlet Get-IAMLoginProfile AWSPowerShell Cmdlet Get-IAMMFADevice AWSPowerShell Cmdlet Get-IAMRole AWSPowerShell Cmdlet Get-IAMRolePolicies AWSPowerShell Cmdlet Get-IAMRolePolicy AWSPowerShell Cmdlet Get-IAMRoles AWSPowerShell Cmdlet Get-IAMServerCertificate AWSPowerShell Cmdlet Get-IAMServerCertificates AWSPowerShell Cmdlet Get-IAMSigningCertificate AWSPowerShell Cmdlet Get-IAMUser AWSPowerShell Cmdlet Get-IAMUserPolicies AWSPowerShell Cmdlet Get-IAMUserPolicy AWSPowerShell Cmdlet Get-IAMUsers AWSPowerShell Cmdlet Get-IAMVirtualMFADevice AWSPowerShell Cmdlet New-IAMAccessKey AWSPowerShell Cmdlet New-IAMAccountAlias AWSPowerShell Cmdlet New-IAMGroup AWSPowerShell Cmdlet New-IAMInstanceProfile AWSPowerShell Cmdlet New-IAMLoginProfile AWSPowerShell Cmdlet New-IAMRole AWSPowerShell Cmdlet New-IAMUser AWSPowerShell Cmdlet New-IAMVirtualMFADevice AWSPowerShell Cmdlet Publish-IAMServerCertificate AWSPowerShell Cmdlet Publish-IAMSigningCertificate AWSPowerShell Cmdlet Remove-IAMAccessKey AWSPowerShell Cmdlet Remove-IAMAccountAlias AWSPowerShell Cmdlet Remove-IAMAccountPasswordPolicy AWSPowerShell Cmdlet Remove-IAMGroup AWSPowerShell Cmdlet Remove-IAMGroupPolicy AWSPowerShell Cmdlet Remove-IAMInstanceProfile AWSPowerShell Cmdlet Remove-IAMLoginProfile AWSPowerShell Cmdlet Remove-IAMRole AWSPowerShell Cmdlet Remove-IAMRoleFromInstanceProfile AWSPowerShell Cmdlet Remove-IAMRolePolicy AWSPowerShell Cmdlet Remove-IAMServerCertificate AWSPowerShell Cmdlet Remove-IAMSigningCertificate AWSPowerShell Cmdlet Remove-IAMUser AWSPowerShell Cmdlet Remove-IAMUserFromGroup AWSPowerShell Cmdlet Remove-IAMUserPolicy AWSPowerShell Cmdlet Remove-IAMVirtualMFADevice AWSPowerShell Cmdlet Sync-IAMMFADevice AWSPowerShell Cmdlet Update-IAMAccessKey AWSPowerShell Cmdlet Update-IAMAccountPasswordPolicy AWSPowerShell Cmdlet Update-IAMAssumeRolePolicy AWSPowerShell Cmdlet Update-IAMGroup AWSPowerShell Cmdlet Update-IAMLoginProfile AWSPowerShell Cmdlet Update-IAMServerCertificate AWSPowerShell Cmdlet Update-IAMSigningCertificate AWSPowerShell Cmdlet Update-IAMUser AWSPowerShell Cmdlet Write-IAMGroupPolicy AWSPowerShell Cmdlet Write-IAMRolePolicy AWSPowerShell Cmdlet Write-IAMUserPolicy AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Get-IEJob AWSPowerShell Cmdlet Get-IEStatus AWSPowerShell Cmdlet New-IEJob AWSPowerShell Cmdlet Stop-IEJob AWSPowerShell Cmdlet Update-IEJob AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Edit-R53ResourceRecordSet AWSPowerShell Cmdlet Get-R53Change AWSPowerShell Cmdlet Get-R53HealthCheck AWSPowerShell Cmdlet Get-R53HealthChecks AWSPowerShell Cmdlet Get-R53HostedZone AWSPowerShell Cmdlet Get-R53HostedZones AWSPowerShell Cmdlet Get-R53ResourceRecordSet AWSPowerShell Cmdlet New-R53HealthCheck AWSPowerShell Cmdlet New-R53HostedZone AWSPowerShell Cmdlet Remove-R53HealthCheck AWSPowerShell Cmdlet Remove-R53HostedZone AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Add-RDSSourceIdentifierToSubscription AWSPowerShell Cmdlet Add-RDSTagsToResource AWSPowerShell Cmdlet Convert-RDSReadReplicaToStandalone AWSPowerShell Cmdlet Copy-RDSDBSnapshot AWSPowerShell Cmdlet Edit-RDSDBInstance AWSPowerShell Cmdlet Edit-RDSDBParameterGroup AWSPowerShell Cmdlet Edit-RDSDBSubnetGroup AWSPowerShell Cmdlet Edit-RDSEventSubscription AWSPowerShell Cmdlet Edit-RDSOptionGroup AWSPowerShell Cmdlet Enable-RDSDBSecurityGroupIngress AWSPowerShell Cmdlet Get-RDSDBEngineVersion AWSPowerShell Cmdlet Get-RDSDBInstance AWSPowerShell Cmdlet Get-RDSDBParameter AWSPowerShell Cmdlet Get-RDSDBParameterGroup AWSPowerShell Cmdlet Get-RDSDBSecurityGroup AWSPowerShell Cmdlet Get-RDSDBSnapshot AWSPowerShell Cmdlet Get-RDSDBSubnetGroup AWSPowerShell Cmdlet Get-RDSEngineDefaultParameter AWSPowerShell Cmdlet Get-RDSEvent AWSPowerShell Cmdlet Get-RDSEventCategories AWSPowerShell Cmdlet Get-RDSEventSubscriptions AWSPowerShell Cmdlet Get-RDSOptionGroup AWSPowerShell Cmdlet Get-RDSOptionGroupOption AWSPowerShell Cmdlet Get-RDSOrderableDBInstanceOption AWSPowerShell Cmdlet Get-RDSReservedDBInstance AWSPowerShell Cmdlet Get-RDSReservedDBInstancesOffering AWSPowerShell Cmdlet Get-RDSReservedDBInstancesOfferings AWSPowerShell Cmdlet Get-RDSTagForResource AWSPowerShell Cmdlet New-RDSDBInstance AWSPowerShell Cmdlet New-RDSDBInstanceReadReplica AWSPowerShell Cmdlet New-RDSDBParameterGroup AWSPowerShell Cmdlet New-RDSDBSecurityGroup AWSPowerShell Cmdlet New-RDSDBSnapshot AWSPowerShell Cmdlet New-RDSDBSubnetGroup AWSPowerShell Cmdlet New-RDSEventSubscription AWSPowerShell Cmdlet New-RDSOptionGroup AWSPowerShell Cmdlet Remove-RDSDBInstance AWSPowerShell Cmdlet Remove-RDSDBParameterGroup AWSPowerShell Cmdlet Remove-RDSDBSecurityGroup AWSPowerShell Cmdlet Remove-RDSDBSnapshot AWSPowerShell Cmdlet Remove-RDSDBSubnetGroup AWSPowerShell Cmdlet Remove-RDSEventSubscription AWSPowerShell Cmdlet Remove-RDSOptionGroup AWSPowerShell Cmdlet Remove-RDSSourceIdentifierFromSubscription AWSPowerShell Cmdlet Remove-RDSTagFromResource AWSPowerShell Cmdlet Reset-RDSDBParameterGroup AWSPowerShell Cmdlet Restart-RDSDBInstance AWSPowerShell Cmdlet Restore-RDSDBInstanceFromDBSnapshot AWSPowerShell Cmdlet Restore-RDSDBInstanceToPointInTime AWSPowerShell Cmdlet Revoke-RDSDBSecurityGroupIngress AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Copy-S3Object AWSPowerShell Cmdlet Disable-S3BucketLogging AWSPowerShell Cmdlet Enable-S3BucketLogging AWSPowerShell Cmdlet Get-S3ACL AWSPowerShell Cmdlet Get-S3Bucket AWSPowerShell Cmdlet Get-S3BucketLocation AWSPowerShell Cmdlet Get-S3BucketLogging AWSPowerShell Cmdlet Get-S3BucketPolicy AWSPowerShell Cmdlet Get-S3BucketTagging AWSPowerShell Cmdlet Get-S3BucketVersioning AWSPowerShell Cmdlet Get-S3BucketWebsite AWSPowerShell Cmdlet Get-S3CORSConfiguration AWSPowerShell Cmdlet Get-S3LifecycleConfiguration AWSPowerShell Cmdlet Get-S3NotificationConfiguration AWSPowerShell Cmdlet Get-S3Object AWSPowerShell Cmdlet Get-S3ObjectMetadata AWSPowerShell Cmdlet Get-S3PreSignedURL AWSPowerShell Cmdlet Get-S3Version AWSPowerShell Cmdlet New-S3Bucket AWSPowerShell Cmdlet Read-S3Object AWSPowerShell Cmdlet Remove-S3Bucket AWSPowerShell Cmdlet Remove-S3BucketPolicy AWSPowerShell Cmdlet Remove-S3BucketTagging AWSPowerShell Cmdlet Remove-S3BucketWebsite AWSPowerShell Cmdlet Remove-S3CORSConfiguration AWSPowerShell Cmdlet Remove-S3LifecycleConfiguration AWSPowerShell Cmdlet Remove-S3Object AWSPowerShell Cmdlet Restore-S3Object AWSPowerShell Cmdlet Set-S3ACL AWSPowerShell Cmdlet Set-S3BucketVersioning AWSPowerShell Cmdlet Set-S3NotificationConfiguration AWSPowerShell Cmdlet Test-S3Bucket AWSPowerShell Cmdlet Write-S3BucketPolicy AWSPowerShell Cmdlet Write-S3BucketTagging AWSPowerShell Cmdlet Write-S3BucketWebsite AWSPowerShell Cmdlet Write-S3CORSConfiguration AWSPowerShell Cmdlet Write-S3LifecycleConfiguration AWSPowerShell Cmdlet Write-S3Object AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Add-SGCache AWSPowerShell Cmdlet Add-SGUploadBuffer AWSPowerShell Cmdlet Add-SGWorkingStorage AWSPowerShell Cmdlet Enable-SGGateway AWSPowerShell Cmdlet Get-SGBandwidthRateLimit AWSPowerShell Cmdlet Get-SGCache AWSPowerShell Cmdlet Get-SGCachediSCSIVolume AWSPowerShell Cmdlet Get-SGChapCredentials AWSPowerShell Cmdlet Get-SGGateway AWSPowerShell Cmdlet Get-SGGatewayInformation AWSPowerShell Cmdlet Get-SGLocalDisk AWSPowerShell Cmdlet Get-SGMaintenanceStartTime AWSPowerShell Cmdlet Get-SGSnapshotSchedule AWSPowerShell Cmdlet Get-SGStorediSCSIVolume AWSPowerShell Cmdlet Get-SGUploadBuffer AWSPowerShell Cmdlet Get-SGVolume AWSPowerShell Cmdlet Get-SGVolumeRecoveryPoint AWSPowerShell Cmdlet Get-SGWorkingStorage AWSPowerShell Cmdlet New-SGCachediSCSIVolume AWSPowerShell Cmdlet New-SGSnapshot AWSPowerShell Cmdlet New-SGSnapshotFromVolumeRecoveryPoint AWSPowerShell Cmdlet New-SGStorediSCSIVolume AWSPowerShell Cmdlet Remove-SGBandwidthRateLimit AWSPowerShell Cmdlet Remove-SGChapCredentials AWSPowerShell Cmdlet Remove-SGGateway AWSPowerShell Cmdlet Remove-SGSnapshotSchedule AWSPowerShell Cmdlet Remove-SGVolume AWSPowerShell Cmdlet Start-SGGateway AWSPowerShell Cmdlet Stop-SGGateway AWSPowerShell Cmdlet Update-SGBandwidthRateLimit AWSPowerShell Cmdlet Update-SGChapCredentials AWSPowerShell Cmdlet Update-SGGatewayInformation AWSPowerShell Cmdlet Update-SGGatewaySoftwareNow AWSPowerShell Cmdlet Update-SGMaintenanceStartTime AWSPowerShell Cmdlet Update-SGSnapshotSchedule AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Confirm-SESDomainDkim AWSPowerShell Cmdlet Confirm-SESDomainIdentity AWSPowerShell Cmdlet Confirm-SESEmailAddress AWSPowerShell Cmdlet Confirm-SESEmailIdentity AWSPowerShell Cmdlet Get-SESIdentity AWSPowerShell Cmdlet Get-SESIdentityDkimAttribute AWSPowerShell Cmdlet Get-SESIdentityNotificationAttribute AWSPowerShell Cmdlet Get-SESIdentityVerificationAttribute AWSPowerShell Cmdlet Get-SESSendQuota AWSPowerShell Cmdlet Get-SESSendStatistics AWSPowerShell Cmdlet Get-SESVerifiedEmailAddress AWSPowerShell Cmdlet Remove-SESIdentity AWSPowerShell Cmdlet Remove-SESVerifiedEmailAddress AWSPowerShell Cmdlet Send-SESEmail AWSPowerShell Cmdlet Send-SESRawEmail AWSPowerShell Cmdlet Set-SESIdentityDkimEnabled AWSPowerShell Cmdlet Set-SESIdentityFeedbackForwardingEnabled AWSPowerShell Cmdlet Set-SESIdentityNotificationTopic AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Add-SNSPermission AWSPowerShell Cmdlet Confirm-SNSSubscription AWSPowerShell Cmdlet Connect-SNSNotification AWSPowerShell Cmdlet Disconnect-SNSNotification AWSPowerShell Cmdlet Get-SNSSubscription AWSPowerShell Cmdlet Get-SNSSubscriptionAttribute AWSPowerShell Cmdlet Get-SNSSubscriptionByTopic AWSPowerShell Cmdlet Get-SNSTopic AWSPowerShell Cmdlet Get-SNSTopicAttribute AWSPowerShell Cmdlet New-SNSTopic AWSPowerShell Cmdlet Publish-SNSMessage AWSPowerShell Cmdlet Remove-SNSPermission AWSPowerShell Cmdlet Remove-SNSTopic AWSPowerShell Cmdlet Set-SNSSubscriptionAttribute AWSPowerShell Cmdlet Set-SNSTopicAttribute AWSPowerShell ------ CommandType Name ModuleName ----------- ---- ---------- Cmdlet Add-SQSPermission AWSPowerShell Cmdlet Edit-SQSMessageVisibility AWSPowerShell Cmdlet Edit-SQSMessageVisibilityBatch AWSPowerShell Cmdlet Get-SQSQueue AWSPowerShell Cmdlet Get-SQSQueueAttribute AWSPowerShell Cmdlet Get-SQSQueueUrl AWSPowerShell Cmdlet New-SQSQueue AWSPowerShell Cmdlet Receive-SQSMessage AWSPowerShell Cmdlet Remove-SQSMessage AWSPowerShell Cmdlet Remove-SQSMessageBatch AWSPowerShell Cmdlet Remove-SQSPermission AWSPowerShell Cmdlet Remove-SQSQueue AWSPowerShell Cmdlet Send-SQSMessage AWSPowerShell Cmdlet Send-SQSMessageBatch AWSPowerShell Cmdlet Set-SQSQueueAttribute AWSPowerShell ------https://console.aws.amazon.com/s3/home CommandType Name ModuleName ----------- ---- ---------- Cmdlet Convert-STSAuthorizationMessage AWSPowerShell Cmdlet Get-STSFederationToken AWSPowerShell Cmdlet Get-STSSessionToken AWSPowerShell Cmdlet Use-STSRole AWSPowerShell Cmdlet Use-STSWebIdentityRole AWSPowerShell
認証情報を確認する
AWSとの認証は3つあります。
- IAM
- アクセスキーとシークレットキー
- インスタンスプロファイル
簡単のためアクセスキーとシークレットキーを利用してみましょう。
AWS Management Consoleの右上にある、 アカウント/コンソールからSecurity Credentialsを選択します。
IAMが有効になっていると、 以下のメッセージのとおりLegacy Security Credentialとしてアクセスキーとシークレットキーが表示されます。 このアクセスキーとシークレットキーは慎重に管理してください。できればIAM使った方がいいです。
Note: If you must retrieve existing secret access keys, use the legacy Security Credentials page and save your keys in a safe place. AWS will support the legacy Security Credentials page for a limited time to help during your transition.
最後に必要なのはリージョンです。東京リージョンの場合は、 ap-northeast-1です。
PS> Get-AWSRegion Region Name IsShellDefault ------ ---- -------------- us-east-1 US East (Virginia) False us-west-1 US West (N. California) False us-west-2 US West (Oregon) False eu-west-1 EU West (Ireland) False ap-northeast-1 Asia Pacific (Tokyo) False ap-southeast-1 Asia Pacific (Singapore) False ap-southeast-2 Asia Pacific (Sydney) False sa-east-1 South America (Sao Paulo) False
認証する
各コマンドは-AccessKey,-SecretKey,-Regionを指定できます。
あるいは、AWSの案内にInitialize-AWSDefaultsコマンドレットで、まとめて設定する方法も紹介されています。
AWSのサンプルは次の通りです。(ダミーデータです。繋げません)
Initialize-AWSDefaults -AccessKey AKIAIOSFODNN7EXAMPLE -SecretKey wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY -Region us-west-2
Initialize-AWSDefaultsコマンドレットで一度認証すれば、そのセッション中は認証が以降不要なので、便利です。
パラメータ化しておく
繰り返し認証データを読み込ませる場合は、パラメータ化しておくと楽です。
$credential = [PSCustomObject]@{ Region = "ap-northeast-1" SecretKey = "SecretKey" AccessKey = "AccessKey" }
ファイルから読み出し
ファイルに保存する場合は、Json形式だとPowerShellでの読み込みが非常に楽なのでおすすめです。
{"Region":"ap-northeast-1","SecretKey":"SecretKey","Accesskey":"AccessKey"}
PowerShellではこのように読めます。
$credential = Get-Content .\Credential.json | ConvertFrom-Json
認証する
後は認証するだけです。
Initialize-AWSDefaults -Region $credential.Region -AccessKey $credential.Accesskey -SecretKey $credential.SecretKey
このような表記が出れば認証成功です。
Initialize-AWSDefaults: Credentials for this shell were set using the supplied key parameters Initialize-AWSDefaults: Region 'ap-northeast-1' was set for this shell using the supplied parameter Default credentials and/or region have been stored to 'AWS PS Default' and set active for this shell.
EC2インスタンスの一覧を取得する
最後にせっかくなので、EC2 Instanceの一覧をGet-EC2Instanceで取得してみましょう。
PS> Get-EC2Instance ReservationId : r-ffffffff OwnerId : 201312242424 RequesterId : GroupId : {} GroupName : {} RunningInstance : {ip-10-0-0-10.ap-northeast-1.compute.internal}
EC2 Instanceの詳細を取得する
しかし、Get-EC2Instanceとうつだけでは各インスタンスのこれでは概要しか分かりません。
詳細を取得するにはRunningInstanceプロパティを指定します。表示内容はAWS Management ConsoleのEC2画面とほぼ同一です。
PS> (Get-EC2Instance).RunningInstance TypeName: Amazon.EC2.Model.RunningInstance Name MemberType Definition ---- ---------- ---------- Equals Method bool Equals(System.Object obj) GetHashCode Method int GetHashCode() GetType Method type GetType() IsSetAmiLaunchIndex Method bool IsSetAmiLaunchIndex() IsSetArchitecture Method bool IsSetArchitecture() IsSetBlockDeviceMapping Method bool IsSetBlockDeviceMapping() IsSetClientToken Method bool IsSetClientToken() IsSetEbsOptimized Method bool IsSetEbsOptimized() IsSetGroupId Method bool IsSetGroupId() IsSetGroupName Method bool IsSetGroupName() IsSetHypervisor Method bool IsSetHypervisor() IsSetImageId Method bool IsSetImageId() IsSetInstanceId Method bool IsSetInstanceId() IsSetInstanceLifecycle Method bool IsSetInstanceLifecycle() IsSetInstanceProfile Method bool IsSetInstanceProfile() IsSetInstanceState Method bool IsSetInstanceState() IsSetInstanceType Method bool IsSetInstanceType() IsSetIpAddress Method bool IsSetIpAddress() IsSetKernelId Method bool IsSetKernelId() IsSetKeyName Method bool IsSetKeyName() IsSetLaunchTime Method bool IsSetLaunchTime() IsSetLicense Method bool IsSetLicense() IsSetMonitoring Method bool IsSetMonitoring() IsSetNetworkInterfaceSet Method bool IsSetNetworkInterfaceSet() IsSetPlacement Method bool IsSetPlacement() IsSetPlatform Method bool IsSetPlatform() IsSetPrivateDnsName Method bool IsSetPrivateDnsName() IsSetPrivateIpAddress Method bool IsSetPrivateIpAddress() IsSetProductCode Method bool IsSetProductCode() IsSetProductCodes Method bool IsSetProductCodes() IsSetPublicDnsName Method bool IsSetPublicDnsName() IsSetRamdiskId Method bool IsSetRamdiskId() IsSetRootDeviceName Method bool IsSetRootDeviceName() IsSetRootDeviceType Method bool IsSetRootDeviceType() IsSetSourceDestCheck Method bool IsSetSourceDestCheck() IsSetSpotInstanceRequestId Method bool IsSetSpotInstanceRequestId() IsSetStateReason Method bool IsSetStateReason() IsSetStateTransitionReason Method bool IsSetStateTransitionReason() IsSetSubnetId Method bool IsSetSubnetId() IsSetTag Method bool IsSetTag() IsSetVirtualizationType Method bool IsSetVirtualizationType() IsSetVpcId Method bool IsSetVpcId() ToString Method string ToString() WithAmiLaunchIndex Method Amazon.EC2.Model.RunningInstance WithAmiLaunchIndex(string amiLaunchIndex) WithArchitecture Method Amazon.EC2.Model.RunningInstance WithArchitecture(string architecture) WithBlockDeviceMapping Method Amazon.EC2.Model.RunningInstance WithBlockDeviceMapping(Params Amazon.EC2.Model.InstanceBlockDeviceMapping[] list) WithClientToken Method Amazon.EC2.Model.RunningInstance WithClientToken(string clientToken) WithEbsOptimized Method Amazon.EC2.Model.RunningInstance WithEbsOptimized(bool ebsOptimized) WithGroupId Method Amazon.EC2.Model.RunningInstance WithGroupId(Params string[] list) WithGroupName Method Amazon.EC2.Model.RunningInstance WithGroupName(Params string[] list) WithHypervisor Method Amazon.EC2.Model.RunningInstance WithHypervisor(string hypervisor) WithImageId Method Amazon.EC2.Model.RunningInstance WithImageId(string imageId) WithInstanceId Method Amazon.EC2.Model.RunningInstance WithInstanceId(string instanceId) WithInstanceLifecycle Method Amazon.EC2.Model.RunningInstance WithInstanceLifecycle(string instanceLifecycle) WithInstanceProfile Method Amazon.EC2.Model.RunningInstance WithInstanceProfile(Amazon.EC2.Model.IAMInstanceProfile instanceProfile) WithInstanceState Method Amazon.EC2.Model.RunningInstance WithInstanceState(Amazon.EC2.Model.InstanceState instanceState) WithInstanceType Method Amazon.EC2.Model.RunningInstance WithInstanceType(string instanceType) WithIpAddress Method Amazon.EC2.Model.RunningInstance WithIpAddress(string ipAddress) WithKernelId Method Amazon.EC2.Model.RunningInstance WithKernelId(string kernelId) WithKeyName Method Amazon.EC2.Model.RunningInstance WithKeyName(string keyName) WithLaunchTime Method Amazon.EC2.Model.RunningInstance WithLaunchTime(string launchTime) WithLicense Method Amazon.EC2.Model.RunningInstance WithLicense(Amazon.EC2.Model.InstanceLicense license) WithMonitoring Method Amazon.EC2.Model.RunningInstance WithMonitoring(Amazon.EC2.Model.Monitoring monitoring) WithNetworkInterfaceSet Method Amazon.EC2.Model.RunningInstance WithNetworkInterfaceSet(Params Amazon.EC2.Model.InstanceNetworkInterface[] list) WithPlacement Method Amazon.EC2.Model.RunningInstance WithPlacement(Amazon.EC2.Model.Placement placement) WithPlatform Method Amazon.EC2.Model.RunningInstance WithPlatform(string platform) WithPrivateDnsName Method Amazon.EC2.Model.RunningInstance WithPrivateDnsName(string privateDnsName) WithPrivateIpAddress Method Amazon.EC2.Model.RunningInstance WithPrivateIpAddress(string privateIpAddress) WithProductCode Method Amazon.EC2.Model.RunningInstance WithProductCode(Params string[] list) WithProductCodes Method Amazon.EC2.Model.RunningInstance WithProductCodes(Params Amazon.EC2.Model.ProductCode[] list) WithPublicDnsName Method Amazon.EC2.Model.RunningInstance WithPublicDnsName(string publicDnsName) WithRamdiskId Method Amazon.EC2.Model.RunningInstance WithRamdiskId(string ramdiskId) WithRootDeviceName Method Amazon.EC2.Model.RunningInstance WithRootDeviceName(string rootDeviceName) WithRootDeviceType Method Amazon.EC2.Model.RunningInstance WithRootDeviceType(string rootDeviceType) WithSourceDestCheck Method Amazon.EC2.Model.RunningInstance WithSourceDestCheck(bool sourceDestCheck) WithSpotInstanceRequestId Method Amazon.EC2.Model.RunningInstance WithSpotInstanceRequestId(string spotInstanceRequestId) WithStateReason Method Amazon.EC2.Model.RunningInstance WithStateReason(Amazon.EC2.Model.StateReason stateReason) WithStateTransitionReason Method Amazon.EC2.Model.RunningInstance WithStateTransitionReason(string stateTransitionReason) WithSubnetId Method Amazon.EC2.Model.RunningInstance WithSubnetId(string subnetId) WithTag Method Amazon.EC2.Model.RunningInstance WithTag(Params Amazon.EC2.Model.Tag[] list) WithVirtualizationType Method Amazon.EC2.Model.RunningInstance WithVirtualizationType(string virtualizationType) WithVpcId Method Amazon.EC2.Model.RunningInstance WithVpcId(string vpcId) AmiLaunchIndex Property string AmiLaunchIndex {get;set;} Architecture Property string Architecture {get;set;} BlockDeviceMapping Property System.Collections.Generic.List[Amazon.EC2.Model.InstanceBlockDeviceMapping] BlockDeviceMapping {get;set;} ClientToken Property string ClientToken {get;set;} EbsOptimized Property bool EbsOptimized {get;set;} GroupId Property System.Collections.Generic.List[string] GroupId {get;set;} GroupName Property System.Collections.Generic.List[string] GroupName {get;set;} ImageId Property string ImageId {get;set;} InstanceId Property string InstanceId {get;set;} InstanceLifecycle Property string InstanceLifecycle {get;set;} InstanceProfile Property Amazon.EC2.Model.IAMInstanceProfile InstanceProfile {get;set;} InstanceState Property Amazon.EC2.Model.InstanceState InstanceState {get;set;} InstanceType Property string InstanceType {get;set;} IpAddress Property string IpAddress {get;set;} KernelId Property string KernelId {get;set;} KeyName Property string KeyName {get;set;} LaunchTime Property string LaunchTime {get;set;} License Property Amazon.EC2.Model.InstanceLicense License {get;set;} Monitoring Property Amazon.EC2.Model.Monitoring Monitoring {get;set;} NetworkInterfaceSet Property System.Collections.Generic.List[Amazon.EC2.Model.InstanceNetworkInterface] NetworkInterfaceSet {get;set;} Placement Property Amazon.EC2.Model.Placement Placement {get;set;} Platform Property string Platform {get;set;} PrivateDnsName Property string PrivateDnsName {get;set;} PrivateIpAddress Property string PrivateIpAddress {get;set;} ProductCode Property System.Collections.Generic.List[string] ProductCode {get;set;} ProductCodes Property System.Collections.Generic.List[Amazon.EC2.Model.ProductCode] ProductCodes {get;set;} PublicDnsName Property string PublicDnsName {get;set;} RamdiskId Property string RamdiskId {get;set;} RootDeviceName Property string RootDeviceName {get;set;} RootDeviceType Property string RootDeviceType {get;set;} SourceDestCheck Property bool SourceDestCheck {get;set;} SpotInstanceRequestId Property string SpotInstanceRequestId {get;set;} StateReason Property Amazon.EC2.Model.StateReason StateReason {get;set;} StateTransitionReason Property string StateTransitionReason {get;set;} SubnetId Property string SubnetId {get;set;} Tag Property System.Collections.Generic.List[Amazon.EC2.Model.Tag] Tag {get;set;} VirtualizationType Property string VirtualizationType {get;set;} VpcId Property string VpcId {get;set;}
Tagはどうするの
TagはHashTableとしてKVで返却されてくるため面倒です。Tagを取得するにはこうします。
(Get-EC2Instance).RunningInstance.tag
TagのNameとしてFirstInstanceを検索するためなら、このようにも書けます。
(Get-EC2Instance).RunningInstance | where {$_.Tag.value -Like "First*"}
まとめ
ゼロから初めて、EC2インスタンスの一覧取得まで見てみました。ここまでくれば、あとは要件に合わせてコマンドレットを自在に組み合わせて下さい。
例えば、ELBに紐づいたEC2インスタンスを、時間帯に応じてPowerShellを介して停止/再開を自動化しています。以前は、停止/開始時に、Linux内部へPowerShellからSSH経由で入って特定のコマンドを実行、最新環境にすることを保障、停止期間中の運用系ファイルの差し替えまで自動化していました。現在は、前面C# + ASP.NETに移行したので、WindowsからPowerShellで実行しています。
より低レイヤーでの自動化を進めることで、 開発に負担をかけず、インフラ管理も自動化して、DevOpsへつなげる切欠を作り出したいところです。 Powershellにはその潜在的な能力がありますし、実例で示していきたい。