usertasks

package
v0.0.0-...-4481de2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TaskStateOpen identifies an issue with an instance that is not yet resolved.
	TaskStateOpen = "OPEN"
	// TaskStateResolved identifies an issue with an instance that is resolved.
	TaskStateResolved = "RESOLVED"
)
View Source
const (
	// AutoDiscoverEC2IssueSSMInstanceNotRegistered is used to identify instances that failed to auto-enroll
	// because they are not present in Amazon Systems Manager.
	// This usually means that the Instance does not have the SSM Agent running,
	// or that the instance's IAM Profile does not allow have the managed IAM Policy AmazonSSMManagedInstanceCore assigned to it.
	AutoDiscoverEC2IssueSSMInstanceNotRegistered = "ec2-ssm-agent-not-registered"

	// AutoDiscoverEC2IssueSSMInstanceConnectionLost is used to identify instances that failed to auto-enroll
	// because the agent lost connection to Amazon Systems Manager.
	// This can happen if the user changed some setting in the instance's network or IAM profile.
	AutoDiscoverEC2IssueSSMInstanceConnectionLost = "ec2-ssm-agent-connection-lost"

	// AutoDiscoverEC2IssueSSMInstanceUnsupportedOS is used to identify instances that failed to auto-enroll
	// because its OS is not supported by teleport.
	// This can happen if the instance is running Windows.
	AutoDiscoverEC2IssueSSMInstanceUnsupportedOS = "ec2-ssm-unsupported-os"

	// AutoDiscoverEC2IssueSSMScriptFailure is used to identify instances that failed to auto-enroll
	// because the installation script failed.
	// The invocation url must be included in the report, so that users can see what was wrong.
	AutoDiscoverEC2IssueSSMScriptFailure = "ec2-ssm-script-failure"

	// AutoDiscoverEC2IssueSSMInvocationFailure is used to identify instances that failed to auto-enroll
	// because the SSM Script Run (also known as Invocation) failed.
	// This happens when there's a failure with permissions or an invalid configuration (eg, invalid document name).
	AutoDiscoverEC2IssueSSMInvocationFailure = "ec2-ssm-invocation-failure"
)

List of Auto Discover EC2 issues identifiers. This value is used to populate the UserTasks.Spec.IssueType for Discover EC2 tasks. The Web UI will then use those identifiers to show detailed instructions on how to fix the issue.

View Source
const (
	// TaskTypeDiscoverEC2 identifies a User Tasks that is created
	// when an auto-enrollment of an EC2 instance fails.
	// UserTasks that have this Task Type must include the DiscoverEC2 field.
	TaskTypeDiscoverEC2 = "discover-ec2"
)

Variables

This section is empty.

Functions

func NewDiscoverEC2UserTask

func NewDiscoverEC2UserTask(spec *usertasksv1.UserTaskSpec, opts ...UserTaskOption) (*usertasksv1.UserTask, error)

NewDiscoverEC2UserTask creates a new DiscoverEC2 User Task Type.

func TaskNameForDiscoverEC2

func TaskNameForDiscoverEC2(parts TaskNameForDiscoverEC2Parts) string

TaskNameForDiscoverEC2 returns a deterministic name for the DiscoverEC2 task type. This method is used to ensure a single UserTask is created to report issues in enrolling EC2 instances for a given integration, issue type, account id and region.

func ValidateUserTask

func ValidateUserTask(ut *usertasksv1.UserTask) error

ValidateUserTask validates the UserTask object without modifying it.

func WithExpiration

func WithExpiration(t time.Time) func(ut *usertasksv1.UserTask)

WithExpiration sets the expiration of the UserTask resource.

Types

type TaskNameForDiscoverEC2Parts

type TaskNameForDiscoverEC2Parts struct {
	Integration     string
	IssueType       string
	AccountID       string
	Region          string
	SSMDocument     string
	InstallerScript string
}

TaskNameForDiscoverEC2Parts are the fields that deterministically compute a Discover EC2 task name. To be used with TaskNameForDiscoverEC2 function.

type UserTaskOption

type UserTaskOption func(ut *usertasksv1.UserTask)

UserTaskOption defines a function that mutates a User Task.

Jump to

Keyboard shortcuts

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