Documentation
¶
Index ¶
- func AssumeIamRole(iamRoleOpts options.IAMRoleOptions) (*sts.Credentials, error)
- func AssumeRoleAndUpdateEnvIfNecessary(gruntOptions *options.TerragruntOptions) error
- func CreateAwsSession(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (*session.Session, error)
- func CreateAwsSessionFromConfig(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (*session.Session, error)
- func GetAWSAccountID(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (string, error)
- func GetAWSCallerIdentity(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (sts.GetCallerIdentityOutput, error)
- func GetAWSIdentityArn(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (string, error)
- func GetAWSPartition(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (string, error)
- func GetAWSUserID(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (string, error)
- func MarshalPolicy(policy Policy) ([]byte, error)
- func ValidateAwsSession(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) error
- type AwsSessionConfig
- type Policy
- type Statement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssumeIamRole ¶
func AssumeIamRole(iamRoleOpts options.IAMRoleOptions) (*sts.Credentials, error)
Make API calls to AWS to assume the IAM role specified and return the temporary AWS credentials to use that role
func AssumeRoleAndUpdateEnvIfNecessary ¶
func AssumeRoleAndUpdateEnvIfNecessary(gruntOptions *options.TerragruntOptions) error
Assume an IAM role, if one is specified, by making API calls to Amazon STS and setting the environment variables we get back inside of gruntOptions.Env
func CreateAwsSession ¶
func CreateAwsSession(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (*session.Session, error)
Returns an AWS session object. The session is configured by either:
- The provided AwsSessionConfig struct, which specifies region (required), profile name (optional), and IAM role to assume (optional).
- The provided TerragruntOptions struct, which specifies any IAM role to assume (optional).
Note that if the AwsSessionConfig object is null, this will return default session credentials using the default credentials chain of the AWS SDK.
func CreateAwsSessionFromConfig ¶
func CreateAwsSessionFromConfig(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (*session.Session, error)
Returns an AWS session object for the given config region (required), profile name (optional), and IAM role to assume (optional), ensuring that the credentials are available.
func GetAWSAccountID ¶
func GetAWSAccountID(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (string, error)
Get the AWS account ID of the current session configuration
func GetAWSCallerIdentity ¶
func GetAWSCallerIdentity(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (sts.GetCallerIdentityOutput, error)
Return the AWS caller identity associated with the current set of credentials
func GetAWSIdentityArn ¶
func GetAWSIdentityArn(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (string, error)
Get the ARN of the AWS identity associated with the current set of credentials
func GetAWSPartition ¶
func GetAWSPartition(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (string, error)
Get the AWS Partition of the current session configuration
func GetAWSUserID ¶
func GetAWSUserID(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) (string, error)
Get the AWS user ID of the current session configuration
func MarshalPolicy ¶
func ValidateAwsSession ¶
func ValidateAwsSession(config *AwsSessionConfig, gruntOptions *options.TerragruntOptions) error
ValidateAwsSession - Validate if current AWS session is valid
Types ¶
type AwsSessionConfig ¶
type AwsSessionConfig struct {
Region string
CustomS3Endpoint string
CustomDynamoDBEndpoint string
Profile string
RoleArn string
CredsFilename string
S3ForcePathStyle bool
DisableComputeChecksums bool
ExternalID string
SessionName string
}
A representation of the configuration options for an AWS Session
type Statement ¶
type Statement struct {
Sid string `json:"Sid"`
Effect string `json:"Effect"`
Principal interface{} `json:"Principal,omitempty"`
NotPrincipal interface{} `json:"NotPrincipal,omitempty"`
Action interface{} `json:"Action"`
Resource interface{} `json:"Resource"`
Condition *map[string]interface{} `json:"Condition,omitempty"`
}
Statement - AWS policy statement Action and Resource - can be string OR array of strings https://docs.aws.amazon.com/IAM//latest/UserGuide/reference_policies_elements_action.html https://docs.aws.amazon.com/IAM//latest/UserGuide/reference_policies_elements_resource.html