Documentation ¶
Overview ¶
Package aws contains aws clients and session.
Package aws contains aws clients and session.
Package aws contains tests for aws clients and session.
Package aws contains tests for aws clients and session.
Package aws contains tests for aws clients and session.
Package aws contains tests for aws clients and session.
Package aws contains tests for aws clients and session.
Package aws contains tests for AWS clients and session.
Package aws contains tests for aws clients and session.
Package aws contains aws clients and session.
Index ¶
- func EnsureCloudformationExists(client CloudformationClient, stackName string, repoName string, ...) (bool, error)
- func EnsureCodeBuildProjectExists(client CodeBuildClient, aftManagementAccountID string, ...) (bool, error)
- func EnsureCodeCommitRepoExists(client CodeCommitClient, repoName string, description string) (bool, error)
- func EnsureCodePipelineExists(client CodePipelineClient, aftManagementAccountID string, ...) (bool, error)
- func EnsureIamRoleExists(client IAMClient, roleName string, trustRelationShipService string, ...) (bool, error)
- func EnsureS3BucketExists(client S3Client, bucketName string, aftManagementAccountID string, ...) (bool, error)
- func UploadToS3(client S3Client, bucketName string, bucketKey string, fileName string) error
- type Client
- func (ac *Client) GetCloudFormationClient() cloudformationiface.CloudFormationAPI
- func (ac *Client) GetCodeBuildClient() codebuildiface.CodeBuildAPI
- func (ac *Client) GetCodeCommitClient() codecommitiface.CodeCommitAPI
- func (ac *Client) GetCodePipelineClient() codepipelineiface.CodePipelineAPI
- func (ac *Client) GetIamClient() iamiface.IAMAPI
- func (ac *Client) GetS3Client() s3iface.S3API
- type ClientMockCloudFormationClient
- type ClientMockCodeBuildClient
- type ClientMockCodeCommitClient
- type ClientMockCodePipelineClient
- type ClientMockIamClient
- type ClientMockS3Client
- type CloudformationClient
- type CodeBuildClient
- type CodeCommitClient
- type CodePipelineClient
- type FileReader
- type IAMClient
- type MockCloudformationClient
- type MockCodeBuildClient
- type MockCodeCommitClient
- type MockCodePipelineClient
- type MockIAMClient
- type MockS3Client
- func (m *MockS3Client) CreateBucket(input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
- func (m *MockS3Client) ListBuckets(input *s3.ListBucketsInput) (*s3.ListBucketsOutput, error)
- func (m *MockS3Client) PutBucketPolicy(input *s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error)
- func (m *MockS3Client) PutBucketTagging(input *s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error)
- func (m *MockS3Client) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)
- func (m *MockS3Client) PutPublicAccessBlock(input *s3.PutPublicAccessBlockInput) (*s3.PutPublicAccessBlockOutput, error)
- func (m *MockS3Client) WaitUntilBucketExists(input *s3.HeadBucketInput) error
- type S3Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureCloudformationExists ¶
func EnsureCloudformationExists(client CloudformationClient, stackName string, repoName string, repoDescription string, bucketName string, zipFileName string) (bool, error)
EnsureCloudformationExists creates a new cloudformation stack with the given name, or returns success if it already exists.
func EnsureCodeBuildProjectExists ¶
func EnsureCodeBuildProjectExists(client CodeBuildClient, aftManagementAccountID string, codeBuildDockerImage string, projectName string, repoName string, repoBranch string, codeBuildRoleName string) (bool, error)
EnsureCodeBuildProjectExists creates a new codebuild project with the given name, or returns success if it already exists.
func EnsureCodeCommitRepoExists ¶
func EnsureCodeCommitRepoExists(client CodeCommitClient, repoName string, description string) (bool, error)
EnsureCodeCommitRepoExists creates a new codecommit repository with the given name, or returns success if it already exists.
func EnsureCodePipelineExists ¶
func EnsureCodePipelineExists(client CodePipelineClient, aftManagementAccountID string, codePipelineRoleName string, pipelineName string, codeSuiteBucketName string, repoName string, branchName string, codeBuildProjectName string) (bool, error)
EnsureCodePipelineExists creates a new codepipeline pipeline with the given name, or returns success if it already exists.
func EnsureIamRoleExists ¶
func EnsureIamRoleExists(client IAMClient, roleName string, trustRelationShipService string, policyName string, region string, aftAccount string, repoName string, bucketName string, terraformStateBucketName string) (bool, error)
EnsureIamRoleExists creates a new IAM Role with the given name, or returns success if it already exists.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct implementing all the client interfaces
func NewClient ¶
func NewClient() *Client
NewClient loads credentials following the chain credentials
func (*Client) GetCloudFormationClient ¶
func (ac *Client) GetCloudFormationClient() cloudformationiface.CloudFormationAPI
GetCloudFormationClient returns the client for AWS CloudFormation service.
func (*Client) GetCodeBuildClient ¶
func (ac *Client) GetCodeBuildClient() codebuildiface.CodeBuildAPI
GetCodeBuildClient returns the client for AWS CodeBuild service.
func (*Client) GetCodeCommitClient ¶
func (ac *Client) GetCodeCommitClient() codecommitiface.CodeCommitAPI
GetCodeCommitClient fetches the CodeCommit Client and enables the cmd to use
func (*Client) GetCodePipelineClient ¶
func (ac *Client) GetCodePipelineClient() codepipelineiface.CodePipelineAPI
GetCodePipelineClient fetches the Code Pipeline Client and enables the cmd to use
func (*Client) GetIamClient ¶
GetIamClient fetches the IAM Client and enables the cmd to use
func (*Client) GetS3Client ¶
GetS3Client fetches the S3 Client and enables the cmd to use
type ClientMockCloudFormationClient ¶
type ClientMockCloudFormationClient struct {
cloudformationiface.CloudFormationAPI
}
ClientMockCloudFormationClient is a mock of CloudFormationAPI
type ClientMockCodeBuildClient ¶
type ClientMockCodeBuildClient struct {
codebuildiface.CodeBuildAPI
}
ClientMockCodeBuildClient is a mock of CodeBuildAPI
type ClientMockCodeCommitClient ¶
type ClientMockCodeCommitClient struct {
codecommitiface.CodeCommitAPI
}
ClientMockCodeCommitClient is a mock of CodeCommitAPI
type ClientMockCodePipelineClient ¶
type ClientMockCodePipelineClient struct {
codepipelineiface.CodePipelineAPI
}
ClientMockCodePipelineClient is a mock of CodePipelineAPI
type ClientMockIamClient ¶
ClientMockIamClient is a mock of IAMAPI
type ClientMockS3Client ¶
ClientMockS3Client is a mock of S3API
type CloudformationClient ¶
type CloudformationClient interface { CreateStack(*cloudformation.CreateStackInput) (*cloudformation.CreateStackOutput, error) DescribeStacks(*cloudformation.DescribeStacksInput) (*cloudformation.DescribeStacksOutput, error) }
CloudformationClient represents a client for Cloudformation.
type CodeBuildClient ¶
type CodeBuildClient interface { CreateProject(*codebuild.CreateProjectInput) (*codebuild.CreateProjectOutput, error) ListProjects(*codebuild.ListProjectsInput) (*codebuild.ListProjectsOutput, error) }
CodeBuildClient represents a client for Amazon Code Build.
type CodeCommitClient ¶
type CodeCommitClient interface { CreateRepository(*codecommit.CreateRepositoryInput) (*codecommit.CreateRepositoryOutput, error) GetRepository(*codecommit.GetRepositoryInput) (*codecommit.GetRepositoryOutput, error) TagResource(*codecommit.TagResourceInput) (*codecommit.TagResourceOutput, error) }
CodeCommitClient represents a client for Amazon Code Commit.
type CodePipelineClient ¶
type CodePipelineClient interface { CreatePipeline(*codepipeline.CreatePipelineInput) (*codepipeline.CreatePipelineOutput, error) ListPipelines(input *codepipeline.ListPipelinesInput) (*codepipeline.ListPipelinesOutput, error) }
CodePipelineClient represents a client for Amazon Code Pipeline.
type FileReader ¶
FileReader is a function type that reads a file and returns its content as a byte slice.
var ReadFile FileReader = os.ReadFile
ReadFile is a variable of type FileReader, initially set to os.ReadFile.
type IAMClient ¶
type IAMClient interface { CreateRole(*iam.CreateRoleInput) (*iam.CreateRoleOutput, error) PutRolePolicy(*iam.PutRolePolicyInput) (*iam.PutRolePolicyOutput, error) GetRole(*iam.GetRoleInput) (*iam.GetRoleOutput, error) }
IAMClient represents a client for Amazon Code Commit.
type MockCloudformationClient ¶
type MockCloudformationClient struct { cloudformationiface.CloudFormationAPI CreateStackFunc func(*cloudformation.CreateStackInput) (*cloudformation.CreateStackOutput, error) DescribeStacksFunc func(*cloudformation.DescribeStacksInput) (*cloudformation.DescribeStacksOutput, error) }
MockCloudformationClient is a mock implementation of an Cloudformation for testing.
func (*MockCloudformationClient) CreateStack ¶
func (m *MockCloudformationClient) CreateStack(input *cloudformation.CreateStackInput) (*cloudformation.CreateStackOutput, error)
CreateStack is a mock implementation of the CreateStack method.
func (*MockCloudformationClient) DescribeStacks ¶
func (m *MockCloudformationClient) DescribeStacks(input *cloudformation.DescribeStacksInput) (*cloudformation.DescribeStacksOutput, error)
DescribeStacks is a mock implementation of the DescribeStacks method.
type MockCodeBuildClient ¶
type MockCodeBuildClient struct { codebuildiface.CodeBuildAPI CreateProjectFunc func(*codebuild.CreateProjectInput) (*codebuild.CreateProjectOutput, error) ListProjectsFunc func(*codebuild.ListProjectsInput) (*codebuild.ListProjectsOutput, error) }
MockCodeBuildClient is a mock implementation of an S3 client for testing.
func (*MockCodeBuildClient) CreateProject ¶
func (m *MockCodeBuildClient) CreateProject(input *codebuild.CreateProjectInput) (*codebuild.CreateProjectOutput, error)
CreateProject is a mock implementation of the CreateProject method.
func (*MockCodeBuildClient) ListProjects ¶
func (m *MockCodeBuildClient) ListProjects(input *codebuild.ListProjectsInput) (*codebuild.ListProjectsOutput, error)
ListProjects is a mock implementation of the ListProjects method.
type MockCodeCommitClient ¶
type MockCodeCommitClient struct { codecommitiface.CodeCommitAPI CreateRepositoryFunc func(*codecommit.CreateRepositoryInput) (*codecommit.CreateRepositoryOutput, error) GetRepositoryFunc func(*codecommit.GetRepositoryInput) (*codecommit.GetRepositoryOutput, error) }
MockCodeCommitClient is a mock implementation of an S3 client for testing.
func (*MockCodeCommitClient) CreateRepository ¶
func (m *MockCodeCommitClient) CreateRepository(input *codecommit.CreateRepositoryInput) (*codecommit.CreateRepositoryOutput, error)
CreateRepository is a mock implementation of the CreateRepository method.
func (*MockCodeCommitClient) GetRepository ¶
func (m *MockCodeCommitClient) GetRepository(input *codecommit.GetRepositoryInput) (*codecommit.GetRepositoryOutput, error)
GetRepository is a mock implementation of the GetRepository method.
type MockCodePipelineClient ¶
type MockCodePipelineClient struct { codepipelineiface.CodePipelineAPI CreatePipelineFunc func(*codepipeline.CreatePipelineInput) (*codepipeline.CreatePipelineOutput, error) ListPipelinesFunc func(*codepipeline.ListPipelinesInput) (*codepipeline.ListPipelinesOutput, error) }
MockCodePipelineClient is a mock implementation of an S3 client for testing.
func (*MockCodePipelineClient) CreatePipeline ¶
func (m *MockCodePipelineClient) CreatePipeline(input *codepipeline.CreatePipelineInput) (*codepipeline.CreatePipelineOutput, error)
CreatePipeline is a mock implementation of the CreatePipeline method.
type MockIAMClient ¶
type MockIAMClient struct { iamiface.IAMAPI CreateRoleFunc func(input *iam.CreateRoleInput) (*iam.CreateRoleOutput, error) PutRolePolicyFunc func(input *iam.PutRolePolicyInput) (*iam.PutRolePolicyOutput, error) GetRoleFunc func(input *iam.GetRoleInput) (*iam.GetRoleOutput, error) }
MockIAMClient is a mock implementation of an IAM client for testing.
func (*MockIAMClient) CreateRole ¶
func (m *MockIAMClient) CreateRole(input *iam.CreateRoleInput) (*iam.CreateRoleOutput, error)
CreateRole is a mock implementation of the CreateRole method.
func (*MockIAMClient) GetRole ¶
func (m *MockIAMClient) GetRole(input *iam.GetRoleInput) (*iam.GetRoleOutput, error)
GetRole is a mock implementation of the GetRoleFunc method.
func (*MockIAMClient) PutRolePolicy ¶
func (m *MockIAMClient) PutRolePolicy(input *iam.PutRolePolicyInput) (*iam.PutRolePolicyOutput, error)
PutRolePolicy is a mock implementation of the PutRolePolicy method.
type MockS3Client ¶
type MockS3Client struct { s3iface.S3API ListBucketsFunc func(input *s3.ListBucketsInput) (*s3.ListBucketsOutput, error) CreateBucketFunc func(input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error) WaitUntilBucketExistsFunc func(*s3.HeadBucketInput) error PutPublicAccessBlockFunc func(input *s3.PutPublicAccessBlockInput) (*s3.PutPublicAccessBlockOutput, error) PutBucketPolicyFunc func(*s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error) PutBucketTaggingFunc func(*s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error) PutObjectFunc func(*s3.PutObjectInput) (*s3.PutObjectOutput, error) }
MockS3Client is a mock implementation of an S3 client for testing.
func (*MockS3Client) CreateBucket ¶
func (m *MockS3Client) CreateBucket(input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
CreateBucket is a mock implementation of the CreateBucket method.
func (*MockS3Client) ListBuckets ¶
func (m *MockS3Client) ListBuckets(input *s3.ListBucketsInput) (*s3.ListBucketsOutput, error)
ListBuckets is a mock implementation of the ListBuckets method.
func (*MockS3Client) PutBucketPolicy ¶
func (m *MockS3Client) PutBucketPolicy(input *s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error)
PutBucketPolicy is a mock implementation of the PutBucketPolicy method.
func (*MockS3Client) PutBucketTagging ¶
func (m *MockS3Client) PutBucketTagging(input *s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error)
PutBucketTagging is a mock implementation of the PutBucketTagging method.
func (*MockS3Client) PutObject ¶
func (m *MockS3Client) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)
PutObject is a mock implementation of the PutObject method.
func (*MockS3Client) PutPublicAccessBlock ¶
func (m *MockS3Client) PutPublicAccessBlock(input *s3.PutPublicAccessBlockInput) (*s3.PutPublicAccessBlockOutput, error)
PutPublicAccessBlock is a mock implementation of the PutPublicAccessBlock method.
func (*MockS3Client) WaitUntilBucketExists ¶
func (m *MockS3Client) WaitUntilBucketExists(input *s3.HeadBucketInput) error
WaitUntilBucketExists is a mock implementation of the WaitUntilBucketExists method.
type S3Client ¶
type S3Client interface { ListBuckets(input *s3.ListBucketsInput) (*s3.ListBucketsOutput, error) CreateBucket(input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error) WaitUntilBucketExists(*s3.HeadBucketInput) error PutPublicAccessBlock(*s3.PutPublicAccessBlockInput) (*s3.PutPublicAccessBlockOutput, error) PutBucketPolicy(*s3.PutBucketPolicyInput) (*s3.PutBucketPolicyOutput, error) PutBucketTagging(*s3.PutBucketTaggingInput) (*s3.PutBucketTaggingOutput, error) PutObject(*s3.PutObjectInput) (*s3.PutObjectOutput, error) }
S3Client represents a client for Amazon S3.