Chapter 2: Getting Started with AWS Lambda
- Which format is not supported by the AWS CLI?
- JSON
- Table
- XML
- Text
Answer: The support values are JSON, table, and text. The default output is JSON.
- Is it recommended to use the AWS root account for everyday interaction with AWS? If yes, why?
Answer: AWS root account has the ultimate authority to create and delete AWS resources, change the billing, and even close the AWS account. Hence, it is strongly recommended to create an IAM user for everyday tasks with only the needed permissions.
- What environment variables do you need to set to use the AWS CLI?
Answer: The following are the required environment variables to configure the AWS CLI:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
- How do you use the AWS CLI with named profiles?
Answer: AWS_PROFILE
can be used to set the CLI profile to use. The profile is stored in the credentials file. By default, AWS CLI uses the default
profile.
- Explain the GOPATH environment variable.
Answer: The GOPATH
environment variable specifies the location of your Go workspace. Default value is $HOME/go
.
- Which command-line command compiles a program in Go?
go build
go run
go fmt
go doc
Answer: The as-mentioned commands do the following:
build
: It is a compile package and dependencies and generate a single binary.run
: It is a compile and run Go program.fmt
: It is a reformat package resources.doc
: It is a show documentation for a package or function.
- What's the Go workspace?
Answer: A Go workspace is a directory where you will load and work with Go code. The directory must have the following hierarchy:
src
: It contains Go source files.bin
: It contains executable files.pkg
: It contains package objects.