aws_helper

package
v0.45.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssumeIamRole added in v0.13.11

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 added in v0.23.36

func AssumeRoleAndUpdateEnvIfNecessary(terragruntOptions *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 terragruntOptions.Env

func CreateAwsSession added in v0.9.5

func CreateAwsSession(config *AwsSessionConfig, terragruntOptions *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 added in v0.29.1

func CreateAwsSessionFromConfig(config *AwsSessionConfig, terragruntOptions *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 added in v0.21.10

func GetAWSAccountID(config *AwsSessionConfig, terragruntOptions *options.TerragruntOptions) (string, error)

Get the AWS account ID of the current session configuration

func GetAWSCallerIdentity added in v0.21.10

func GetAWSCallerIdentity(config *AwsSessionConfig, terragruntOptions *options.TerragruntOptions) (sts.GetCallerIdentityOutput, error)

Return the AWS caller identity associated with the current set of credentials

func GetAWSIdentityArn added in v0.21.10

func GetAWSIdentityArn(config *AwsSessionConfig, terragruntOptions *options.TerragruntOptions) (string, error)

Get the ARN of the AWS identity associated with the current set of credentials

func GetAWSPartition added in v0.30.5

func GetAWSPartition(config *AwsSessionConfig, terragruntOptions *options.TerragruntOptions) (string, error)

Get the AWS Partition of the current session configuration

func GetAWSUserID added in v0.21.10

func GetAWSUserID(config *AwsSessionConfig, terragruntOptions *options.TerragruntOptions) (string, error)

Get the AWS user ID of the current session configuration

func MarshalPolicy added in v0.37.0

func MarshalPolicy(policy Policy) ([]byte, error)

Types

type AwsSessionConfig added in v0.16.9

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 Policy added in v0.37.0

type Policy struct {
	Version   string      `json:"Version"`
	Statement []Statement `json:"Statement"`
}

Policy - representation of the policy for AWS

func UnmarshalPolicy added in v0.37.0

func UnmarshalPolicy(policy string) (Policy, error)

type Statement added in v0.37.0

type Statement struct {
	Sid       string                  `json:"Sid"`
	Effect    string                  `json:"Effect"`
	Principal interface{}             `json:"Principal"`
	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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL