CLIãéåžžã«å¥œã人ãããŸãïŒåºå žïŒImgurïŒ
å 責äºé ïŒããã¯èšäºã®ç¿»èš³ã§ããããªãªãžãã«ã¯ããã«ãããŸã ã
ã¯ã©ãŠãã³ã³ãã¥ãŒãã£ã³ã°ã人æ°ãåããŠããäžæ¹ã§ãä»æ¥ã®å€ãã®ã€ã³ã¿ãŒããããžã£ã€ã¢ã³ãã®ä»äºãæäŸããããã€ã®ã¯ã©ãŠããµãŒãã¹ãç·šæãã¹ããã®åºæºãèšå®ããŠããAmazon Web ServicesïŒAWSïŒãã©ãããã©ãŒã ã¯ãã¯ã©ãŠãã³ã³ãã¥ãŒãã£ã³ã°åžå Žã§è°è«ã®äœå°ã®ãªããªãŒããŒã«ãªã£ãŠããŸãã å¢ãç¶ãããµãŒãã¹ãšæäŸããæ©äŒã掻çšããæ¹æ³ãç解ããããã«ãDevOpsãšã³ãžãã¢ã¯Amazonãèšå®ããã¯ã©ãŠããã¯ãããžãŒã®ããŒã¹ã«ã€ããŠããå¿ èŠããããŸããããã¯å®éã®ãã¹ãã«ãªããŸãã
DevOpsã¯ãæ¥éã«æé·ããŠããAWSã€ã³ãã©ã¹ãã©ã¯ãã£ãããé©åã«ç®¡çããæ¹æ³ãããèããŸãã ãã®ããã«ãGUIïŒ AWSã³ã³ãœãŒã« ïŒãŸãã¯CLIïŒ AWS CLI ïŒã䜿çšããæ¹ãè¯ããã©ãããæ€èšããŠããŸãã ãããšããäž¡æ¹ã䜿çšããŸããïŒ
DevOpsã®äœæ¥ãä¿é²ããããã«äœæããã3çªç®ã®ãªãã·ã§ã³awless.io -Goã§äœæãããAWSã®æ°ãããªãŒãã³ãœãŒã¹CLIã«æ³šç®ããŠãã ããã ãã®ãããžã§ã¯ãã¯ãAWSã®ããã¯ã¹ã¿ãŒã§ãããžã§ãããŒã«ãã£ãŠæ¿èªããããããæ°ãæã§GitHubã§2.5Kãè¶ ããã¹ã¿ãŒãéããŸããã ãã®èšäºã§ã¯ãç§ãåããŠããäŒç€Ÿã§ããWallixãawless.ioãäœæããçç±ãšããã®ããŒã«ãDevOpsã«åœ¹ç«ã€ãšèããçç±ã説æããŸãã
ãšããã§ããããã®ãã€ãŒãã¯äœã«ã€ããŠè©±ããŠããã®ã§ããïŒ
GUIã奜ãå«ã
AWSã¯å€ãã®ãµãŒãã¹ãæäŸããŸã
ã·ã¹ãã 管çè ã¯äžè¬çã«GUIãå«ããŸãã Linux Foundation ã¯ãããããåå¿è ã®éåœã ãšèããŠããŸãã AWSã³ã³ãœãŒã«ã¯äŸå€ã§ããïŒ ã³ã³ãœãŒã«ã«ã¯ã䜿çšå¯èœãªãã¹ãŠã®ãµãŒãã¹ã管çããæ©èœããããæ§æãŠã£ã¶ãŒãã䜿çšããŠããŸããŸãªã¿ã¹ã¯ã解決ã§ããŸãã ç¹ã«1åéãã®ã¿ã¹ã¯ãå®è¡ããå Žåãã³ã³ãœãŒã«ãæäŸããæ©äŒã«æè¬ããŸãã ãã®å Žåã®ããã»ã¹ã®èŠèŠåã¯éåžžã«äŸ¿å©ã§ãã ããããGUIã䜿çšããæšæºçãªå埩ã¿ã¹ã¯ã®è§£æ±ºã«ã¯æéãããããããçµéšè±å¯ãªãŠãŒã¶ãŒãèªåããæãåºãå¯èœæ§ããããŸãã
AWSã³ã³ãœãŒã«ã®6çªç®ã®ã¹ãããã«ããããŸã ã€ã³ã¹ã¿ã³ã¹ãäœæããŠããŸãã
GUIã䜿çšãããšãã¢ã¯ã·ã§ã³ãèªååããããèªåã«ã¡ã¢ãæ®ããããç¹å®ã®æäœãå®è¡ããããã«ååãšå¯Ÿè©±ãããããã®ãå°é£ã§ãã ååãååïŒãŸãã¯ãããšãã°ããæ¯ããïŒã«é»è©±ã§èª¬æãããšããWebã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšããŠäœããè¡ãæ¹æ³ã説æããŸããã ããã¯æ¬åœã«è¿·æã§ãã
AWS CLIã®åé¡
äžæ¹ãCLIã¯æ¥åžžçãªã¿ã¹ã¯ã«æé©ã§ãã CLIã§äºåèšå®ããåŸããã°ã€ã³æ å ±ãæåã§å ¥åããããããŠã¹ã«è§Šãããããããšãªããäœã§ãã§ããŸãã
ããšãã°ãt1.microã€ã³ã¹ã¿ã³ã¹ãå®è¡ããã«ã¯ã次ã®ã³ãã³ãã§ååã§ãã
find \ -name "sws" > aws ec2 run-instances --image-id ami-xxxxxxxx --count 1 --instance-type t1.micro \ --key-name keypair-xxxxxxxx --security-groups sg-xxxxxxxx
Amazon Machine Image IdentifierïŒAMIïŒãŸãã¯ããŒãã¢åãèŠããã®ã¯ç°¡åã§ã¯ãªããããããŸãããããã®åé¡ã¯alias shellã³ãã³ãã䜿çšããŠè§£æ±ºã§ããããšã«æ³šæããŠãã ããã ããšãã°ãéå§ããã«ã¯ãç®çã®ã»ãã¥ãªãã£ã°ã«ãŒããèŠã€ããŸãã
> aws ec2 describe-security-groups --group-name "awless-secgroup"
åºåããã°ã«ãŒãIDãååŸããŸããããã©ã«ãã§ã¯æ¬¡ã®ããã«ãªããŸãã
{ "SecurityGroups": [ { "IpPermissionsEgress": [ { "PrefixListIds": [], "FromPort": 80, "IpRanges": [ { "CidrIp": "0.0.0.0/0" } ], "ToPort": 80, "IpProtocol": "tcp", "UserIdGroupPairs": [], "Ipv6Ranges": [] }, { "PrefixListIds": [], "FromPort": 443, "IpRanges": [ { "CidrIp": "0.0.0.0/0" } ], "ToPort": 443, "IpProtocol": "tcp", "UserIdGroupPairs": [], "Ipv6Ranges": [] } ], "Description": "awless-secgroup", "IpPermissions": [ { "PrefixListIds": [], "FromPort": 22, "IpRanges": [ { "CidrIp": "0.0.0.0/0" } ], "ToPort": 22, "IpProtocol": "tcp", "UserIdGroupPairs": [], "Ipv6Ranges": [] } ], "GroupName": "awless-secgroup", "VpcId": "vpc-00b68c65", "OwnerId": "519101999238", "GroupId": "sg-687a5d0e" } ] }
ãã®ã¢ãããŒãã¯ãAWSã³ã³ãœãŒã«ã䜿çšããããããé«åºŠãã«èŠããŸãããå¿ ããã䟿å©ã§å¹ççã§ã¯ãããŸããã aws CLIã䜿çšããå Žåãã³ãã³ãã®å ¥åããä»ã®ã¢ã¯ã·ã§ã³ïŒä»¥åã®ã³ãã³ãã®åºåã®ã³ããŒãJSONã¹ããããã®ç·šéãªã©ïŒã®å®è¡ã«çµ¶ããåãæ¿ããå¿ èŠããããŸãã aws CLIã®æ¢åã®ãªãŒãã³ãœãŒã¹ã®ä»£æ¿ã¯ãæäœã®æ§æããããã«å€æŽããã ãã§ã匷調衚瀺ããªãŒãã³ã³ããªãŒãããã®ä»ã®ãã€ãã¹ã«ãè¿œå ããŸãã
AWS CloudFormationãªã©ã®ããŒã«ã¯ã¹ã¿ãã¯ã®äœæã«äŸ¿å©ã§ãããé©åãªãã³ãã¬ãŒãã®äœæã¯å¥ã®ã¿ã¹ã¯ã§ããããã³ãã¬ãŒãèªäœãããã€ãã®ã³ãã³ãã®æåå®è¡ãåžžã«çœ®ãæããããšã¯ã§ããŸããã aws CLIã䜿çšããŠCloudFormationãã³ãã¬ãŒãã䜿çšããŠäœæããããªãœãŒã¹ãèŠã€ããããšãããšãèŠãã¿ãŸããã IDãèšè¿°ããå¿ èŠãããJSONã®é©åãªå Žæããããã€ãåäœã§èŠã€ããã®ã¯ç°¡åãªäœæ¥ã§ã¯ãããŸããã æçµçã«ãGUIãæŸæ£ããŠäœ¿çšããŸããã
çŸè±¡awless.io
awless.ioã¯ãAWSã®ä»£æ¿CLIã§ãããå æ¬çãªæ©èœã®åã§äœ¿ããããã匷調ãããŠããŸãã ãã®ããŒã«ã§ã¯ãæ¢åã®ããŒã ãå€æŽããããšã«ãããå¯èœãªã¿ã¹ã¯ã®90ïŒ ãç°¡çŽ åããããåªããŠããŸãã
awless.ioã¯ãAWS CLIã®åãªãããã³ããšã³ãã§ã¯ãããŸãããå ¬åŒã®AWS Go SDKã䜿çšããŠGoã§èšè¿°ãããæ°ããã³ã³ãœãŒã«ã€ã³ã¿ãŒãã§ã€ã¹ã§ãã ããã¯ãApacheã©ã€ã»ã³ã¹ã®äžã§ãªãªãŒã¹ãããå®å šã«ãªãŒãã³ãœãŒã¹ã®ãããžã§ã¯ãã§ãã Awless.ioã¯çŸåšã次ã®AWSãµãŒãã¹ããµããŒãããŠããŸãïŒIAMãEC2ïŒELBv2ãå«ãïŒãS3ãRoute53ãRDSãSQSãSNSãCloudfrontãCloudwatchãCloudFormationãããã³Lambdaã è¿ãå°æ¥ããã®ãªã¹ããæ¡å€§ããäºå®ã§ãã
ããšããšãawless.ioã¯Wallixã®ã€ãããŒã·ã§ã³éšéã«ãã£ãŠéçºãããå€ãã®ç€Ÿå ã®èª²é¡ã«å¯ŸåŠããŠããŸããã äºå®äžWallixã¯éçºãåŸæŽããŸããããæ¬è³ªçã«awless.ioã¯éçºè ã³ãã¥ããã£ã«ãã£ãŠäœæããããããžã§ã¯ãã§ãããããªãã®åå ã匷ããå§ãããŸãã
awless.ioã®å©ç¹
awless.ioãäœæãããšããgitãªã©ã®äžè¬çãªããŒã«ã§èŠå®ãããŠããååã«åŸãããã«ããŸããã ã»ãšãã©ã®ããŒã ã®åœ¢åŒã¯æ¬¡ã®ãšããã§ãã
awless [verb] [noun] [parameter=value ...]
ããšãã°ããããã¯ãã¹ãŠå¯èœãªã³ãã³ãã§ãã
# awless list users # awless create instance # awless attach user name=my-user-name group=my-group # awless run https://example.com/create_vpc.aws
awless.ioã®åºæ¬ååã«ã¯ä»¥äžãå«ãŸããŸãã
- ãã¹ããŒããããã©ã«ãèšå®ã®äœ¿çšãããã«ãããã¯ã©ãŠããã¯ãããžãŒã«é¢ããæå°éã®ç¥èã§ãããŒã«ã䜿çšã§ããŸãã
- èªã¿ãããã解æã«äŸ¿å©ãªåœ¢åŒã§åºåãããæ å ±
- ã€ã³ãã©ã¹ãã©ã¯ãã£ã¢ãã«ã®ã³ããŒãRDFã°ã©ãïŒãªãœãŒã¹èšè¿°ãã¬ãŒã ã¯ãŒã¯ïŒã®åœ¢åŒã§ããŒã«ã«ã«ä¿åããŸããããã«ããããªã¢ãŒãã§ã¯ãªããããã«ã¢ã¯ã»ã¹ããŠèšç®ãå®è¡ã§ããŸãã
awless.ioã¯ãããŸããŸãªæäœã®æ§æã§åãåè©ïŒ list ã create ã deleteãªã© ïŒã䜿çšããããšã匷調ããŠããŸããããã«ãããã³ãã³ãã»ãããå°ããïŒèŠããããïŒãªããŸãã æ§æã¯ããŸããŸãªãµãŒãã¹ã«çµ±äžãããŠããŸãã ããšãã°ã次ã®ããã«èšè¿°ã§ããŸãã
awless list [instances|users|buckets|records]
代ããã«ïŒ
aws ec2 describe-instances aws iam list-users aws s3api list-buckets aws route53 list-resource-record-sets
awless.ioã®äœ¿çšãéå§ãã
awless.ioã¯githubã§å ¥æã§ããŸãã ãŸãã ã³ã³ãã€ã«ãããããã±ãŒãžãšããŠãHomebrew for macOSãéããŠé åžããŸã ã
brew tap wallix/awless; brew install awless
Goãã·ã¹ãã ã«ã€ã³ã¹ããŒã«ãããŠããå ŽåããœãŒã¹ããã®ãã«ãã¯éåžžã«ç°¡åã§ãã
go get -u github.com/wallix/awless
æåã®èµ·åæã«ãawless.ioã¯è³æ Œæ å ±ãèŠæ±ããŸãããŸãã¯ãaws-cliãã·ã¹ãã ã«ã€ã³ã¹ããŒã«ããã³æ§æãããŠããå Žåã¯ãæ§æããèªåçã«åŒãåºããŸãã ããã«ã bashãŸãã¯zshã®ãªãŒãã³ã³ããªãŒããã€ã³ã¹ããŒã«ãã䟡å€ããããŸãã
AWSã€ã³ãã©ã¹ãã©ã¯ãã£ã調ã¹ã
awless.ioã¯ããããã€ãããAWSã€ã³ãã©ã¹ãã©ã¯ãã£ãããã²ãŒãããããã®å¹ åºããªãã·ã§ã³ãDevOpsã«æäŸããŸãã ãã®ããã®2ã€ã®äž»ãªã³ãã³ãã¯listãšshowã§ãã ãªãœãŒã¹ã®ã¿ã€ãããšã«ãawless.ioã¯æåã«æãé¢é£æ§ã®é«ãæ å ±ã衚瀺ããŸãã
ãªããžã§ã¯ãã®ãªã¹ã
awless.ioã䜿çšãããšããŠãŒã¶ãŒãã»ãã¥ãªãã£ã°ã«ãŒããã€ã³ã¹ã¿ã³ã¹ãªã©ãããããçš®é¡ã®AWSãªããžã§ã¯ããäžèŠ§è¡šç€ºã§ããŸãã
> awless list users | ID â² | NAME | LASTUSED | CREATED | |-----------------------|-----------|----------|-----------| | AIDAI37GETCRRVNLDKFYQ | hbinsztok | 8 days | 10 months | | AIDAI3FX74KAQQKIOM2XY | awless-ts | 13 weeks | 4 months | [âŠ]
端æ«ã®å¹ ãããŒã¿ãå®å šã«è¡šç€ºã§ããªãå Žåãåã¯èªåçã«åãæšãŠããããã®ãããªæ å ±ãé衚瀺ã«ãªã£ããšããèŠåã衚瀺ãããŸãã
> awless list securitygroups | ID â² | VPC | INBOUND | |-------------|--------------|-------------------------------------| | sg-1d578b64 | vpc-00b68c65 | [0.0.0.0/0](tcp:1433) | | | | [0.0.0.0/0;::/0](tcp:443) | | | | [::/0;0.0.0.0/0](tcp:80) | | | | [::/0;0.0.0.0/0](tcp:2242) | | | | [::/0;0.0.0.0/0](tcp:22) | | | | [0.0.0.0/0](tcp:3389) | | sg-30abc756 | vpc-00b68c65 | [0.0.0.0/0](tcp:443) | | | | [0.0.0.0/0](tcp:80) | [...] Columns truncated to fit terminal: 'Outbound', 'Name', 'Description'
åºåã¯ç°¡åãã€èªç¶ã«ãœãŒãããã³ãã£ã«ã¿ãªã³ã°ãããŸãã
> awless list instance --sort uptime --filter zone=eu-west-1b | ID | ZONE | NAME | STATE | |---------------------|------------|---------------------|---------| | i-03a1f22b36ddb0739 | eu-west-1b | blog-test | running | | i-05adde5a930da5ed3 | eu-west-1b | authoringtest | stopped | | i-06b8f07c1e4afb49a | eu-west-1b | AwlessWithScheduler | running | [...] Columns truncated to fit terminal: 'Type', 'Public IP', 'Private IP', 'Uptime', 'KeyPair'
åºå圢åŒã¯ã«ã¹ã¿ãã€ãºã§ããŸãã ããã©ã«ãã§ã¯ãããŒã¿ã¯äººéãèªã¿åããããŒãã«ã«åºåãããŸãïŒçµæã¯markdownã«åºåãããããã¯pandocãªã©ã®ãµãŒãããŒãã£ããŒã«ãžã®å ¥åãšããŠæž¡ãããšãã§ããŸãïŒã ããŒã¿ã¯ãcsvãjsonããŸãã¯tsv圢åŒã§ãåºåã§ããŸãã
> awless list subnets --format csv ID,Name,CIDR,Zone,Default,Vpc,Public,State subnet-0c41ad68,,172.31.0.0/20,eu-west-1a,true,vpc-00b68c65,true,available subnet-2486b17c,demo-env-subnet,10.0.0.0/24,eu-west-1c,false,vpc-67b25c00,true,available [...]
awless.ioã®éç«ã£ãæ©èœã®1ã€ã¯ã RDFã°ã©ããšããŠæ瀺ãããã€ã³ãã©ã¹ãã©ã¯ãã£ãæäœããè€éãªã¯ãšãªãããŒã«ã«ã§å®è¡ããæ©èœã§ãã æšæºåããã圢åŒã䜿çšãããšã Protégéãªã©ã®æ¢åã®ããŒã«ã䜿çšããŠãã°ã©ãã§ã¯ãšãªãå®è¡ã§ããŸãã ããŒã«ã«ã«ä¿åãããã°ã©ãã䜿çšãããšãã€ã³ã¿ãŒãããã«ã¢ã¯ã»ã¹ããªããŠããããçšåºŠã€ã³ãã©ã¹ãã©ã¯ãã£ãæäœã§ããŸãã
> ping amazon.com ping: cannot resolve amazon.com: Unknown host > awless list instances --local | ID â² | ZONE | NAME | STATE | |---------------------|------------|---------------------|---------| | i-01b17116fed0a09bd | eu-west-1c | windows-demo-env | running | | i-05c0a275adb5484fa | eu-west-1c | git.inno.wallix.com | running | | i-06b8f07c1e4afb49a | eu-west-1b | AwlessWithScheduler | running | [...]<br />
ãªãœãŒã¹æ å ±ã®ååŸ
showã³ãã³ãã䜿çšãããšããªãœãŒã¹ã«é¢ããæ å ±ãååŸã§ããŸãã
> awless show i-03a1f22b36ddb0739 | PROPERTY â² | VALUE | |-------------------|---------------------| | Architecture | x86_64 | | Hypervisor | xen | | ID | i-03a1f22b36ddb0739 | | Image | ami-70edb016 | | KeyPair | keypair-blog | | Name | blog-test | | NetworkInterfaces | [eni-10e4352d] | | Private IP | 10.0.20.245 | | Public IP | 34.252.193.183 |<br /> | RootDevice | /dev/xvda | | RootDeviceType | ebs | | SecurityGroups | [sg-a2a282c4] | | State | running | | Subnet | subnet-472a1731 | | Type | t2.micro | | Uptime | 46 hours | | Vpc | vpc-96c7eef2 | | Zone | eu-west-1b | eu-west-1[region] â³ @awless-test-vpc[vpc] â³ @awless-public-subnet[subnet] â³ @blog-test[instance] Depending on: keypair-blog[keypair], @default[securitygroup], vol-0f82cd93824f456e5[volume] Siblings: @AwlessWithScheduler[instance]
ãã®ã³ãã³ãã¯ãã¯ã©ãŠããªãœãŒã¹ã®ç¹æ§ãšäŸåé¢ä¿ã衚瀺ããŸãã ããšãã°ãã€ã³ã¹ã¿ã³ã¹ã®å ŽåãããŒã ã¯Virtual Private CloudïŒVPCïŒããµãããããããã«é¢é£ä»ãããããªããžã§ã¯ããããã³ããŠã³ããããããªã¥ãŒã ãããŒãã¢ãããã³ã€ã³ã¹ã¿ã³ã¹ã»ãã¥ãªãã£ã°ã«ãŒãã«é¢ããæ å ±ã衚瀺ããŸãã ããããã£ã®ãªã¹ãã¯ããªãœãŒã¹ã®ã¿ã€ãã«ãã£ãŠç°ãªããŸãã
> awless show AIDAI3FX74KAQQKIOM2XY | PROPERTY â² | VALUE | |------------------|-----------------------------------------------| | Arn | arn:aws:iam::519101999238:user/awless-test-usr| | Created | 4 months | | ID | AIDAI3FX74KAQQKIOM2XY | | Name | awless-test-user | | PasswordLastUsed | 2 weeks | | Path | / | Depending on: @PepsWallixS3Assume[policy], @PepsWallixS3[policy]
åäžè¡ãšãã¿ãŒã³
awless.ioã¯ãã¯ã©ãŠããªãœãŒã¹ã衚瀺ããã³åæããããã®åªããããŒã«ã§ãã ãã ããã€ã³ãã©ã¹ãã©ã¯ãã£æäœïŒãªãœãŒã¹ã®äœæãç·šéãåé€ïŒããµããŒããã匷åãªãã³ãã¬ãŒããšã³ãžã³ãæäŸããŸãã
åç·
awless.ioãã³ãã¬ãŒãã¯ãåäžè¡ã³ãã³ããå ¥åããããã¹ã¯ãªããã䜿çšããŠé©çšã§ããŸãã ä»ã®ã¿ã€ãã®ã€ã³ã¹ã¿ã³ã¹ãããŒãã¢ããŸãã¯ãªãœãŒã¹ãäœæããã«ã¯ã2ã€ã®ç°¡åãªã³ãã³ãã§ååã§ãã
> awless create instance > awless create keypair
awless.ioã§ã¯ãå¿ èŠãªãã¹ãŠã®æ å ±ãäžåºŠã«å ¥åããå¿ èŠã¯ãããŸããã 代ããã«ãæäœã®é²è¡ã«å¿ããŠããŒã¿ãèŠæ±ããå ¥åæã«èªåè£å®ãæäŸããŸãã
ãŸããSSHãä»ããŠããã«äœæããã€ã³ã¹ã¿ã³ã¹ã«æ¥ç¶ããããã«äœ¿çšããããŒãã¢ãäœæããŸãã
> awless create keypair Please specify (Ctrl+C to quit, Tab for completion): keypair.name? keypair-blog create keypair name=keypair-blog Confirm? (y/n): y [info] Generating locally a RSA 4096 bits keypair⊠[info] 4096 RSA keypair generated locally and stored in '/Users/henri/.awless/keys/keypair-blog.pem' OK keypair = keypair-blog [info] Revert this template with `awless revert 01BHAE1C0CPMNYQ0KFPRQQ7XYA`
awless create keypairã³ãã³ã ã keypair -blogããŒãã¢ã®ååã®ã¿ãå ¥åãã äœæã確èªããŸããã
awless.ioã¯ãèšå®å¯èœãªã³ãã³ãã©ã€ã³å ¥åãšããã©ã«ããªãã·ã§ã³ïŒAMIãã€ã³ã¹ã¿ã³ã¹ã¿ã€ããªã©ïŒã®äž¡æ¹ã䜿çšããŸãã awless.ioã¯ãæ¢åã®ã€ã³ãã©ã¹ãã©ã¯ãã£ã«å€æŽãå ããåã«ãŠãŒã¶ãŒã®ç¢ºèªãæ±ããŸãã
ããã§ãæ°ããããŒãã¢ã䜿çšããŠç°¡åã«ã€ã³ã¹ã¿ã³ã¹ãäœæã§ããŸãã
> awless create instance keypair=@keypair-blog Please specify (Ctrl+C to quit, Tab for completion): instance.name? instance-blog instance.subnet? <Tab> @awless-private-subnet @awless-public-subnet @demo-env-subnet instance.subnet? @demo-env-subnet create instance count=1 image=ami-70edb016 keypair=keypair-blog name=instance-blog subnet=subnet-2486b17c type=t2.micro Confirm? (y/n): y [info] create tag 'Name=instance-blog' on 'i-094ceffee40892f66' done [info] create instance 'i-094ceffee40892f66' done OK instance = i-094ceffee40892f66 [info] Revert this template with `awless revert 01BHAGCXY80FPK5FR73GTWWSD2`
ã€ã³ã¹ã¿ã³ã¹ã«çŽæ¥æ¥ç¶ããã«ã¯ã sshã³ãã³ãã䜿çšã§ããŸãã
> awless ssh instance-blog awless could not validate the authenticity of '34.252.193.183:22' (unknown host) ecdsa-sha2-nistp256 public key fingerprint is SHA256:Ay8ODMNQiEt1U6BoTsPyIajoaHZ047v7uNjTV1SSQmk. Do you want to continue connecting and persist this key to '/Users/henri/.ssh/known_hosts' (yes/no)? yes [info] Login as 'ec2-user' on '34.252.193.183', using keypair '/Users/henri/.awless/keys/keypair-blog.pem' with ssh client '/usr/bin/ssh' __| __|_ ) _| ( / Amazon Linux AMI ___|\___|___| https://aws.amazon.com/amazon-linux-ami/2016.09-release-notes/ 18 package(s) needed for security, out of 52 available Run âsudo yum updateâ to apply all updates. Amazon Linux version 2017.03 is available. [ec2-user@ip-10â0â20â245 ~]$
ã³ãã³ããžã®åŒæ°ãšããŠããŒãæž¡ãå¿ èŠã¯ãããŸããã ãããã¯ããŒã«ã«ã«ä¿åãããããããŠãŒã¶ãŒåãæå®ããå¿ èŠã¯ãããŸããã awless.ioã¯èªåã§æšæž¬ããŸãã æªéã¯è©³çŽ°ã«ãããawless.ioã¯CLIãå¯èœãªéã䟿å©ã«ããããã«å¯èœãªéãã®ããšããã¹ãŠè¡ããŸãã
ç°¡ç¥åãããçãã³ãã³ãã«å ããŠããµãŒãã¹ã«ã¯ä»ã®æ°ãã䟿å©ãªæ©èœããããŸãã ã³ãã³ãã®åã®åºåã泚æããŠèªãã å Žåãæåããåã¢ã¯ã·ã§ã³ã«åŸ©å IDãé¢é£ä»ããããŠããããšã«æ°ä»ããããããŸããã å®éãã»ãšãã©ã®awless.ioãã³ãã¬ãŒãïŒåäžè¡ããã³å®å šãªã¹ã¯ãªããïŒã®å®è¡ã®çµæãšããŠã®å€æŽã¯ãéåžžã«ç°¡åã«ãã£ã³ã»ã«ã§ããŸãã
gitãšåæ§ãawless.ioã¯å®äºããæäœã®ãã°ãä¿æããŸãã
> awless log [...] ID: 01BHAE1C0CPMNYQ0KFPRQQ7XYA, Date: May 29 17:43:50, Author: user/hbinsztok, Region: eu-west-1 OK create keypair name=keypair-blog[keypair-blog] ID: 01BHAGCXY80FPK5FR73GTWWSD2, Date: May 29 18:25:06, Author: user/hbinsztok, Region: eu-west-1 OK create instance count=1 image=ami-70edb016 keypair=keypair-blog name=instance-blog subnet=subnet-2486b17c type=t2.micro [i-094ceffee40892f66]
ãŸããã³ããããšåæ§ã«ãæäœãç°¡åã«ããŒã«ããã¯ã§ããŸãã
> awless revert 01BHAGCXY80FPK5FR73GTWWSD2 delete instance id=i-094ceffee40892f66 Confirm? (y/n): y OK delete instance
ãã¿ãŒã³
以åã¯ã1ã€ã®ã³ãã³ãïŒåäžè¡ïŒã®ã¿ãå«ããã³ãã¬ãŒãã䜿çšããŸããã äžè¬ã«ããã³ãã¬ãŒãã¯äžè¬åã§ãããawless.ioã³ãã³ãã®ã·ãŒã±ã³ã¹ã§ãã
# securitygroup = create securitygroup vpc={instance.vpc} description={securitygroup.description} name=ssh-from-internet # 22 update securitygroup id=$securitygroup inbound=authorize protocol=tcp cidr=0.0.0.0/0 portrange=22 # keypair = create keypair name={keypair.name} # , , create instance subnet={instance.subnet} image={instance.image} type={instance.type} keypair=$keypair name={instance.name} count=1 securitygroup=$securitygroup
ã³ãã³ããã§ãŒã³ãæ§ç¯ããããã®æ¬¡ã®æ©èœãè¿œå ããŸããã
- æäœã®çµæã¯ãå€æ°ã察å¿ããæ§æã value = commandã«ä¿åã§ããŸãã å°æ¥ãä¿åãããå€ã¯æ¬¡ã®ããã«ã¢ã¯ã»ã¹ã§ããŸã ã
- ãã³ãã¬ãŒããã©ã¡ãŒã¿ã®äœ¿çšãã€ãŸã awless.ioãå®è¡æã«èŠæ±ããã³ãã³ãåŒæ°ããããŸããã ãããã¯ãäžèšã®äŸã®{instance.image}ã®ããã«ãäžæ¬åŒ§ã§æžãããŠããŸã ã
ãã³ãã¬ãŒãã¯awless.ioã®éåžžã«å¹æçã§äŸ¿å©ãªæ©èœã§ãã ããšãã°ããããã䜿çšãããšã次ã®ããšãç°¡åã«ã§ããŸãã
- çããã³ãã¬ãŒãã䜿çšããŠãWordpressãµã€ãã«ä¿¡é Œæ§ã®é«ãè² è·åæ£ã€ã³ãã©ã¹ãã©ã¯ãã£ãå±éããŸãã
- ã€ã³ã¹ã¿ã³ã¹ã®èªå·±æ¡åŒµå¯èœãªã°ã«ãŒããäœæããå¿ èŠã«å¿ããŠæ°ããã€ã³ã¹ã¿ã³ã¹ãåçã«äœæããããã«ãåå人ã®CPUã®è² è·ã远跡ããŸãã
ãã³ãã¬ãŒããåŒæ°ãšããŠå®è¡ããã«ã¯ãå ¬åŒã®awless-templatesãªããžããªãŒã«ãã¡ã€ã«åïŒæ¥é èŸrepoïŒãä»ããŠïŒ ãURLããŸãã¯docãã¡ã€ã«ãã³ãã¬ãŒãã®ååãæž¡ãããšãã§ããŸãã
> awless run repo:dynamic_autoscaling_watching_CPU
èªåã§è©ŠããŠã¿ãŠãã ããïŒ ç¹ã«ãã®åŸãäžèšã§èª¬æããawless revertã³ãã³ãã䜿çšããŠããã³ãã¬ãŒãïŒã€ã³ã¹ã¿ã³ã¹ãã»ãã¥ãªãã£ã°ã«ãŒããã¿ãŒã²ããã°ã«ãŒããã¿ãŒã²ãããã©ã³ãµãŒãªã©ïŒãå®è¡ããçµæãšããŠäœæããããã¹ãŠã®ãªãœãŒã¹ãåé€ã§ããŸãã
ãããŸã§ã®ãšããããã³ãã¬ãŒããšã³ãžã³ã®ãã©ããããŒãžã§ã³ã®ã¿ãå®è£ ããŠãããawless.io 1.0ã®ãªãªãŒã¹åã«ãå€æŽãæ°ããæ©èœãè¿œå ã§ããããšã«æ³šæããŠãã ããã ãªãªãŒã¹1.0以éããã¹ãŠã®æ°ããããŒãžã§ã³ã«ã¯ã移è¡ãç°¡çŽ åãããŠãŒãã£ãªãã£ãä»å±ããŸãã
ããŒã ã®æŠèŠ
次ã®ãããªawless.ioé¢æ°ã«é¢ãããã«ããååŸã§ããŸãã
> awless help > awless [verb] -h
ãããã® è¡šã¯ãã³ãã³ãããã³ãã³ãã¬ãŒãã§äœ¿çšãããäž»ãªããŒã¯ãŒãããŸãšãããã®ã§ãã
ãããŠããã¯ã»ãã®å§ãŸãã§ã
ä»æ¥ã2017幎1æã«ãããžã§ã¯ããéå§ãããŠãã20以äžã®ã¢ã«ãã¡ãªãªãŒã¹ããªãªãŒã¹ãããåŸãawless.io 0.1.0ãçºè¡šããŸãã ãã®ãããžã§ã¯ãã¯ãŸã éçºäžã§ãã ç¹ã«ãAWSã®ãµãŒãã¹ãšæ©èœã®ãµããŒããè¿œå ãããªã©ãããŸããŸãªæ¹æ³ã§è£œåãæ¹åããäºå®ã§ãã ãæ°ã«å ¥ãã®ãµãŒãã¹ïŒãŸã ïŒããµããŒããããŠããªãå Žåã¯ãGitHubã§æ°ãããµãŒãã¹ãéãããæ¢åã®åé¡ãè¿œå ããŠãã ããã ããããæ¥å¹Žã«è¿œå ããäºå®ã®éçºèšç»ãšæ©èœã§ãã
- 0.2.0-ããã€ãã®å°åã§äœæ¥ããŸãã ããŒã«ã«ã°ã©ãã䜿çšããŠãå°åã«å¿ãããªãœãŒã¹ã®éžæãææ¡ããŸãã ãªãŒãžã§ã³éã®ç°¡åãªåãæ¿ãã
- 0.3.0-ã¹ã¯ãªããèšèªã®æ¹åã AWSåŽã§ãªã¯ãšã¹ããå®è¡ããåã«ãšã©ãŒã蚺æããããã«ãã»ãã³ãã£ã¯ã¹ã®æ£åŒãªèª¬æãäœæãããã³ãã¬ãŒãã®ã¿ã€ããã§ãã¯ãè¿œå ããŸãïŒããã¯ãã©ã€ã©ã³ã«ãé©çšãããŸãïŒã
- 0.3.0-ã¹ã¯ãªããèšèªã®æ¹åã AWSåŽã§ãªã¯ãšã¹ããå®è¡ããåã«ãšã©ãŒã蚺æããããã«ãã»ãã³ãã£ã¯ã¹ã®æ£åŒãªèª¬æãäœæãããã³ãã¬ãŒãã®ã¿ã€ããã§ãã¯ãè¿œå ããŸãïŒããã¯ãã©ã€ã©ã³ã«ãé©çšãããŸãïŒã
- 0.4.0-ããŒã«ã«ã°ã©ãã䜿çšããŠã°ããŒãã«ã€ã³ãã©ã¹ãã©ã¯ãã£ã«è€éãªã¯ãšãªãå®è¡ããæ©èœãè¿œå ããŸãã
ããªããããªãã®å人ã«ããã«ã€ããŠè©±ããã©ãããå«ããŠãç§ãã¡ã¯ããªãããããžã§ã¯ãã®å®æœã§ããªããæŽå©ããããšãããããæããŸãã ãããŠããã¹ãŠã®æè¡é©æ°ãææ°ã®ç¶æ ã«ä¿ã€ããã«ãå ¬åŒãã€ãã¿ãŒ@awlessCLIã®ãã¥ãŒã¹ããã©ããŒããŠãã ãã ã