Documentation ¶
Overview ¶
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/
Copyright (C) HashiCorp, Inc.
This is a modified and enhanced version of the original source code.
The original source code contained in this file can be found at https://github.com/hashicorp/terraform-provider-aws/blob/bbefb8dfad459bc1846038b1da4c5857afe55bd9/aws/provider.go#L1314
Index ¶
- Constants
- func AWSCredsFromConfig(conf *Config) (*session.Session, *sts.Credentials)
- func AWSCredsFromValues(region, profile string, assumeRole *AssumeRoleConfig) (*session.Session, *sts.Credentials)
- func AWSSession(region, profile string, assumeRoleConfig *AssumeRoleConfig) *session.Session
- func AssumeRole(sess *session.Session, config AssumeRoleConfig) (*session.Session, *sts.Credentials, error)
- func Hash(data interface{}) string
- func NewSession(region, profile string) *session.Session
- func PrepareExecutable(defaultPath, pkgAndCmdName, pkgVersion string) (*string, error)
- func SetOutput(d *schema.ResourceData, v string)
- type AssumeRoleConfig
- type CommandResult
- type Config
- type Context
- func (e *Context) Create(cmd *exec.Cmd, d *schema.ResourceData, id string) error
- func (e *Context) Delete(cmd *exec.Cmd) error
- func (e *Context) Run(cmd *exec.Cmd) (*CommandResult, error)
- func (e *Context) Session() *session.Session
- func (e *Context) Update(cmd *exec.Cmd, d *schema.ResourceData) error
- type Job
- type Outputter
Constants ¶
const KeyOutput = "output"
Variables ¶
This section is empty.
Functions ¶
func AWSCredsFromConfig ¶
func AWSCredsFromConfig(conf *Config) (*session.Session, *sts.Credentials)
func AWSCredsFromValues ¶
func AWSCredsFromValues(region, profile string, assumeRole *AssumeRoleConfig) (*session.Session, *sts.Credentials)
func AWSSession ¶
func AWSSession(region, profile string, assumeRoleConfig *AssumeRoleConfig) *session.Session
func AssumeRole ¶
func AssumeRole(sess *session.Session, config AssumeRoleConfig) (*session.Session, *sts.Credentials, error)
func NewSession ¶
NewSession creates a new AWS session for the given AWS region.
The following credential sources are supported:
1. static credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) 2. static credentials loaded from profiles (AWS_PROFILE, when AWS_SDK_LOAD_CONFIG=true) 3. dynamic credentials obtained by assuming the role using static credentials loaded from the profile (AWS_PROFILE, when AWS_SDK_LOAD_CONFIG=true) 4. dynamic credentials obtained by assuming the role using static credentials loaded from the env (FORCE_AWS_PROFILE=true w/ credential_source=Environment)
The fourth option of using FORCE_AWS_PROFILE=true and AWS_PROFILE=yourprofile is equivalent to `aws --profile ${AWS_PROFILE}`. See https://github.com/variantdev/vals/issues/19#issuecomment-600437486 for more details and why and when this is needed.
func PrepareExecutable ¶
func SetOutput ¶
func SetOutput(d *schema.ResourceData, v string)
Types ¶
type AssumeRoleConfig ¶
type CommandResult ¶
CommandResult is a wrapper around both the input and output attributes that are relavent for updates
func NewCommandResult ¶
func NewCommandResult() *CommandResult
NewCommandResult is the constructor for CommandResult
type Config ¶
type Config struct { Region string Profile string AssumeRole *AssumeRoleConfig }
type Context ¶
type Context struct { Creds *sts.Credentials Sess *session.Session }