package s3control

import "github.com/aws/aws-sdk-go-v2/service/s3control"

Package s3control provides the client and types for making API requests to AWS S3 Control.

AWS S3 Control provides access to Amazon S3 control plane operations.

See https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20 for more information on this service.

See s3control package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/s3control/

Using the Client

To AWS S3 Control with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the AWS S3 Control client S3Control for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/s3control/#New

Index

Constants

const (
	ServiceName = "s3-control" // Service endpoint prefix API calls made to.
	EndpointsID = ServiceName  // Service ID for Regions and Endpoints metadata.
)

Service information constants

const (

	// ErrCodeNoSuchPublicAccessBlockConfiguration for service response error code
	// "NoSuchPublicAccessBlockConfiguration".
	//
	// This exception is thrown if a GetPublicAccessBlock request is made against
	// an account that does not have a PublicAccessBlockConfiguration set.
	ErrCodeNoSuchPublicAccessBlockConfiguration = "NoSuchPublicAccessBlockConfiguration"
)

Types

type DeletePublicAccessBlockInput

type DeletePublicAccessBlockInput struct {

	// The Account ID for the Amazon Web Services account whose Public Access Block
	// configuration you want to remove.
	//
	// AccountId is a required field
	AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlockRequest

func (DeletePublicAccessBlockInput) GoString

func (s DeletePublicAccessBlockInput) GoString() string

GoString returns the string representation

func (DeletePublicAccessBlockInput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (DeletePublicAccessBlockInput) String

String returns the string representation

func (*DeletePublicAccessBlockInput) Validate

func (s *DeletePublicAccessBlockInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DeletePublicAccessBlockOutput

type DeletePublicAccessBlockOutput struct {
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlockOutput

func (DeletePublicAccessBlockOutput) GoString

GoString returns the string representation

func (DeletePublicAccessBlockOutput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (DeletePublicAccessBlockOutput) SDKResponseMetadata

func (s DeletePublicAccessBlockOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (DeletePublicAccessBlockOutput) String

String returns the string representation

type DeletePublicAccessBlockRequest

type DeletePublicAccessBlockRequest struct {
	*aws.Request
	Input *DeletePublicAccessBlockInput
	Copy  func(*DeletePublicAccessBlockInput) DeletePublicAccessBlockRequest
}

DeletePublicAccessBlockRequest is a API request type for the DeletePublicAccessBlock API operation.

func (DeletePublicAccessBlockRequest) Send

Send marshals and sends the DeletePublicAccessBlock API request.

type GetPublicAccessBlockInput

type GetPublicAccessBlockInput struct {

	// The Account ID for the Amazon Web Services account whose Public Access Block
	// configuration you want to retrieve.
	//
	// AccountId is a required field
	AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlockRequest

func (GetPublicAccessBlockInput) GoString

func (s GetPublicAccessBlockInput) GoString() string

GoString returns the string representation

func (GetPublicAccessBlockInput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (GetPublicAccessBlockInput) String

func (s GetPublicAccessBlockInput) String() string

String returns the string representation

func (*GetPublicAccessBlockInput) Validate

func (s *GetPublicAccessBlockInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetPublicAccessBlockOutput

type GetPublicAccessBlockOutput struct {

	// The Public Access Block configuration currently in effect for this Amazon
	// Web Services account.
	PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `type:"structure"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlockOutput

func (GetPublicAccessBlockOutput) GoString

func (s GetPublicAccessBlockOutput) GoString() string

GoString returns the string representation

func (GetPublicAccessBlockOutput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (GetPublicAccessBlockOutput) SDKResponseMetadata

func (s GetPublicAccessBlockOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (GetPublicAccessBlockOutput) String

String returns the string representation

type GetPublicAccessBlockRequest

type GetPublicAccessBlockRequest struct {
	*aws.Request
	Input *GetPublicAccessBlockInput
	Copy  func(*GetPublicAccessBlockInput) GetPublicAccessBlockRequest
}

GetPublicAccessBlockRequest is a API request type for the GetPublicAccessBlock API operation.

func (GetPublicAccessBlockRequest) Send

Send marshals and sends the GetPublicAccessBlock API request.

type PublicAccessBlockConfiguration

type PublicAccessBlockConfiguration struct {

	// Specifies whether Amazon S3 should block public ACLs for buckets in this
	// account. Setting this element to TRUE causes the following behavior:
	//
	//    * PUT Bucket acl and PUT Object acl calls will fail if the specified ACL
	//    allows public access.
	//
	//    * PUT Object calls will fail if the request includes an object ACL.
	//
	// Note that enabling this setting doesn't affect existing policies or ACLs.
	BlockPublicAcls *bool `locationName:"BlockPublicAcls" type:"boolean"`

	// Specifies whether Amazon S3 should block public bucket policies for buckets
	// in this account. Setting this element to TRUE causes Amazon S3 to reject
	// calls to PUT Bucket policy if the specified bucket policy allows public access.
	//
	// Note that enabling this setting doesn't affect existing bucket policies.
	BlockPublicPolicy *bool `locationName:"BlockPublicPolicy" type:"boolean"`

	// Specifies whether Amazon S3 should ignore public ACLs for buckets in this
	// account. Setting this element to TRUE causes Amazon S3 to ignore all public
	// ACLs on buckets in this account and any objects that they contain.
	//
	// Note that enabling this setting doesn't affect the persistence of any existing
	// ACLs and doesn't prevent new public ACLs from being set.
	IgnorePublicAcls *bool `locationName:"IgnorePublicAcls" type:"boolean"`

	// Specifies whether Amazon S3 should restrict public bucket policies for buckets
	// in this account. If this element is set to TRUE, then only the bucket owner
	// and AWS Services can access buckets with public policies.
	//
	// Note that enabling this setting doesn't affect previously stored bucket policies,
	// except that public and cross-account access within any public bucket policy,
	// including non-public delegation to specific accounts, is blocked.
	RestrictPublicBuckets *bool `locationName:"RestrictPublicBuckets" type:"boolean"`
	// contains filtered or unexported fields
}

The container element for all Public Access Block configuration options. You can enable the configuration options in any combination.

Amazon S3 considers a bucket policy public unless at least one of the following conditions is true:

The policy limits access to a set of CIDRs using aws:SourceIp. For more information on CIDR, see http://www.rfc-editor.org/rfc/rfc4632.txt (http://www.rfc-editor.org/rfc/rfc4632.txt)

The policy grants permissions, not including any "bad actions," to one of the following:

A fixed AWS principal, user, role, or service principal

A fixed aws:SourceArn

A fixed aws:SourceVpc

A fixed aws:SourceVpce

A fixed aws:SourceOwner

A fixed aws:SourceAccount

A fixed value of s3:x-amz-server-side-encryption-aws-kms-key-id

A fixed value of aws:userid outside the pattern "AROLEID:*"

"Bad actions" are those that could expose the data inside a bucket to reads or writes by the public. These actions are s3:Get*, s3:List*, s3:AbortMultipartUpload, s3:Delete*, s3:Put*, and s3:RestoreObject.

The star notation for bad actions indicates that all matching operations are considered bad actions. For example, because s3:Get* is a bad action, s3:GetObject, s3:GetObjectVersion, and s3:GetObjectAcl are all bad actions. Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PublicAccessBlockConfiguration

func (PublicAccessBlockConfiguration) GoString

GoString returns the string representation

func (PublicAccessBlockConfiguration) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (PublicAccessBlockConfiguration) String

String returns the string representation

type PutPublicAccessBlockInput

type PutPublicAccessBlockInput struct {

	// The Account ID for the Amazon Web Services account whose Public Access Block
	// configuration you want to set.
	//
	// AccountId is a required field
	AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"`

	// The Public Access Block configuration that you want to apply to this Amazon
	// Web Services account.
	//
	// PublicAccessBlockConfiguration is a required field
	PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `locationName:"PublicAccessBlockConfiguration" type:"structure" required:"true" xmlURI:"http://awss3control.amazonaws.com/doc/2018-08-20/"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlockRequest

func (PutPublicAccessBlockInput) GoString

func (s PutPublicAccessBlockInput) GoString() string

GoString returns the string representation

func (PutPublicAccessBlockInput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (PutPublicAccessBlockInput) String

func (s PutPublicAccessBlockInput) String() string

String returns the string representation

func (*PutPublicAccessBlockInput) Validate

func (s *PutPublicAccessBlockInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type PutPublicAccessBlockOutput

type PutPublicAccessBlockOutput struct {
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlockOutput

func (PutPublicAccessBlockOutput) GoString

func (s PutPublicAccessBlockOutput) GoString() string

GoString returns the string representation

func (PutPublicAccessBlockOutput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (PutPublicAccessBlockOutput) SDKResponseMetadata

func (s PutPublicAccessBlockOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (PutPublicAccessBlockOutput) String

String returns the string representation

type PutPublicAccessBlockRequest

type PutPublicAccessBlockRequest struct {
	*aws.Request
	Input *PutPublicAccessBlockInput
	Copy  func(*PutPublicAccessBlockInput) PutPublicAccessBlockRequest
}

PutPublicAccessBlockRequest is a API request type for the PutPublicAccessBlock API operation.

func (PutPublicAccessBlockRequest) Send

Send marshals and sends the PutPublicAccessBlock API request.

type S3Control

type S3Control struct {
	*aws.Client
}

S3Control provides the API operation methods for making requests to AWS S3 Control. See this package's package overview docs for details on the service.

S3Control methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(config aws.Config) *S3Control

New creates a new instance of the S3Control client with a config.

Example:

// Create a S3Control client from just a config.
svc := s3control.New(myConfig)

func (*S3Control) DeletePublicAccessBlockRequest

func (c *S3Control) DeletePublicAccessBlockRequest(input *DeletePublicAccessBlockInput) DeletePublicAccessBlockRequest

DeletePublicAccessBlockRequest returns a request value for making API operation for AWS S3 Control.

Removes the Public Access Block configuration for an Amazon Web Services account.

// Example sending a request using the DeletePublicAccessBlockRequest method.
req := client.DeletePublicAccessBlockRequest(params)
resp, err := req.Send()
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlock

func (*S3Control) GetPublicAccessBlockRequest

func (c *S3Control) GetPublicAccessBlockRequest(input *GetPublicAccessBlockInput) GetPublicAccessBlockRequest

GetPublicAccessBlockRequest returns a request value for making API operation for AWS S3 Control.

Retrieves the Public Access Block configuration for an Amazon Web Services account.

// Example sending a request using the GetPublicAccessBlockRequest method.
req := client.GetPublicAccessBlockRequest(params)
resp, err := req.Send()
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock

func (*S3Control) PutPublicAccessBlockRequest

func (c *S3Control) PutPublicAccessBlockRequest(input *PutPublicAccessBlockInput) PutPublicAccessBlockRequest

PutPublicAccessBlockRequest returns a request value for making API operation for AWS S3 Control.

Creates or modifies the Public Access Block configuration for an Amazon Web Services account.

// Example sending a request using the PutPublicAccessBlockRequest method.
req := client.PutPublicAccessBlockRequest(params)
resp, err := req.Send()
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock

Source Files

api.go customizations.go doc.go errors.go service.go

Directories

PathSynopsis
service/s3control/s3controlifacePackage s3controliface provides an interface to enable mocking the AWS S3 Control service client for testing your code.
Version
v0.6.0
Published
Dec 3, 2018
Platform
darwin/amd64
Imports
6 packages
Last checked
2 minutes ago

Tools for package owners.