asmsecret

package
v1.44.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceName is the name of the asmsecret resource
	ResourceName = "asmsecret"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ASMSecretResource

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

ASMSecretResource represents secrets as a task resource. The secrets are stored in AWS Secrets Manager.

func NewASMSecretResource

func NewASMSecretResource(taskARN string,
	asmSecrets map[string]apicontainer.Secret,
	executionCredentialsID string,
	credentialsManager credentials.Manager,
	asmClientCreator factory.ClientCreator) *ASMSecretResource

NewASMSecretResource creates a new ASMSecretResource object

func (*ASMSecretResource) ApplyTransition

func (secret *ASMSecretResource) ApplyTransition(nextState resourcestatus.ResourceStatus) error

ApplyTransition calls the function required to move to the specified status

func (*ASMSecretResource) BuildContainerDependency added in v1.38.0

func (secret *ASMSecretResource) BuildContainerDependency(containerName string, satisfied apicontainerstatus.ContainerStatus,
	dependent resourcestatus.ResourceStatus)

func (*ASMSecretResource) Cleanup

func (secret *ASMSecretResource) Cleanup() error

Cleanup removes the secret value created for the task

func (*ASMSecretResource) Create

func (secret *ASMSecretResource) Create() error

It spins up multiple goroutines in order to retrieve values in parallel.

func (*ASMSecretResource) DependOnTaskNetwork added in v1.38.0

func (secret *ASMSecretResource) DependOnTaskNetwork() bool

func (*ASMSecretResource) DesiredTerminal

func (secret *ASMSecretResource) DesiredTerminal() bool

DesiredTerminal returns true if the secret's desired status is REMOVED

func (*ASMSecretResource) GetAppliedStatus added in v1.38.0

func (secret *ASMSecretResource) GetAppliedStatus() resourcestatus.ResourceStatus

GetAppliedStatus safely returns the currently applied status of the resource

func (*ASMSecretResource) GetCachedSecretValue

func (secret *ASMSecretResource) GetCachedSecretValue(secretKey string) (string, bool)

GetCachedSecretValue retrieves the secret value from secretData field

func (*ASMSecretResource) GetContainerDependencies added in v1.38.0

func (secret *ASMSecretResource) GetContainerDependencies(dependent resourcestatus.ResourceStatus) []apicontainer.ContainerDependency

func (*ASMSecretResource) GetCreatedAt

func (secret *ASMSecretResource) GetCreatedAt() time.Time

GetCreatedAt sets the timestamp for resource's creation time

func (*ASMSecretResource) GetDesiredStatus

func (secret *ASMSecretResource) GetDesiredStatus() resourcestatus.ResourceStatus

GetDesiredStatus safely returns the desired status of the task

func (*ASMSecretResource) GetKnownStatus

func (secret *ASMSecretResource) GetKnownStatus() resourcestatus.ResourceStatus

GetKnownStatus safely returns the currently known status of the task

func (*ASMSecretResource) GetName

func (secret *ASMSecretResource) GetName() string

GetName safely returns the name of the resource

func (*ASMSecretResource) GetTerminalReason

func (secret *ASMSecretResource) GetTerminalReason() string

GetTerminalReason returns an error string to propagate up through to task state change messages

func (*ASMSecretResource) Initialize

func (secret *ASMSecretResource) Initialize(resourceFields *taskresource.ResourceFields,
	taskKnownStatus status.TaskStatus,
	taskDesiredStatus status.TaskStatus)

func (*ASMSecretResource) KnownCreated

func (secret *ASMSecretResource) KnownCreated() bool

KnownCreated returns true if the secret's known status is CREATED

func (*ASMSecretResource) MarshalJSON

func (secret *ASMSecretResource) MarshalJSON() ([]byte, error)

MarshalJSON serialises the ASMSecretResource struct to JSON

func (*ASMSecretResource) NextKnownState

func (secret *ASMSecretResource) NextKnownState() resourcestatus.ResourceStatus

NextKnownState returns the state that the resource should progress to based on its `KnownState`.

func (*ASMSecretResource) SetAppliedStatus

func (secret *ASMSecretResource) SetAppliedStatus(status resourcestatus.ResourceStatus) bool

SetAppliedStatus sets the applied status of resource and returns whether the resource is already in a transition

func (*ASMSecretResource) SetCachedSecretValue

func (secret *ASMSecretResource) SetCachedSecretValue(secretKey string, secretValue string)

SetCachedSecretValue set the secret value in the secretData field given the key and value

func (*ASMSecretResource) SetCreatedAt

func (secret *ASMSecretResource) SetCreatedAt(createdAt time.Time)

SetCreatedAt sets the timestamp for resource's creation time

func (*ASMSecretResource) SetDesiredStatus

func (secret *ASMSecretResource) SetDesiredStatus(status resourcestatus.ResourceStatus)

SetDesiredStatus safely sets the desired status of the resource

func (*ASMSecretResource) SetKnownStatus

func (secret *ASMSecretResource) SetKnownStatus(status resourcestatus.ResourceStatus)

SetKnownStatus safely sets the currently known status of the resource

func (*ASMSecretResource) StatusString

func (secret *ASMSecretResource) StatusString(status resourcestatus.ResourceStatus) string

StatusString returns the string of the cgroup resource status

func (*ASMSecretResource) SteadyState

func (secret *ASMSecretResource) SteadyState() resourcestatus.ResourceStatus

SteadyState returns the transition state of the resource defined as "ready"

func (*ASMSecretResource) TerminalStatus

func (secret *ASMSecretResource) TerminalStatus() resourcestatus.ResourceStatus

TerminalStatus returns the last transition state of asmsecret

func (*ASMSecretResource) UnmarshalJSON

func (secret *ASMSecretResource) UnmarshalJSON(b []byte) error

UnmarshalJSON deserialises the raw JSON to a ASMSecretResource struct

type ASMSecretResourceJSON

type ASMSecretResourceJSON struct {
	TaskARN                string                         `json:"taskARN"`
	CreatedAt              *time.Time                     `json:"createdAt,omitempty"`
	DesiredStatus          *ASMSecretStatus               `json:"desiredStatus"`
	KnownStatus            *ASMSecretStatus               `json:"knownStatus"`
	RequiredSecrets        map[string]apicontainer.Secret `json:"secretResources"`
	ExecutionCredentialsID string                         `json:"executionCredentialsID"`
}

type ASMSecretStatus

type ASMSecretStatus resourcestatus.ResourceStatus
const (
	// is the zero state of a task resource
	ASMSecretStatusNone ASMSecretStatus = iota
	// represents a task resource which has been created
	ASMSecretCreated
	// represents a task resource which has been cleaned up
	ASMSecretRemoved
)

func (*ASMSecretStatus) MarshalJSON

func (as *ASMSecretStatus) MarshalJSON() ([]byte, error)

MarshalJSON overrides the logic for JSON-encoding the ResourceStatus type

func (ASMSecretStatus) String

func (as ASMSecretStatus) String() string

StatusString returns a human readable string representation of this object

func (*ASMSecretStatus) UnmarshalJSON

func (as *ASMSecretStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON overrides the logic for parsing the JSON-encoded ResourceStatus data

Jump to

Keyboard shortcuts

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