{"modulePath":"github.com/Method-Security/methodaws","version":"v0.0.51","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package current\n\nPackage current contains all logic and data structures relevant to the current state of the AWS instance. It is primarily leveraged by the \\`methodaws current\\` subcommand.\n\n## Types\n\n```go\ntype AWSResource struct {\n\tIdentityDocument imds.InstanceIdentityDocument `json:\"identityDocument\" yaml:\"identityDocument\"`\n\tHostname         string                        `json:\"hostname\" yaml:\"hostname\"`\n\tPublicIP         string                        `json:\"publicIp\" yaml:\"publicIp\"`\n\tPublicHostname   string                        `json:\"publicHostname\" yaml:\"publicHostname\"`\n}\n```\nAWSResource contains the instance identity document, hostname, public IP, and public hostname of the current AWS instance. It is used to represent the current state of the instance.\n\n```go\ntype AWSResourceReport struct {\n\tResource AWSResource `json:\"resource\" yaml:\"resource\"`\n\tErrors   []string    `json:\"errors\" yaml:\"errors\"`\n}\n```\nAWSResourceReport contains the AWSResource and any errors that occurred during the execution of the \\`methodaws current instance\\` subcommand.\n\n```go\nfunc InstanceDetails(ctx context.Context, cfg aws.Config) (AWSResourceReport, error)\n```\nInstanceDetails is responsible for gathering the instance identity document, hostname, public IP, and public hostname of the current AWS instance. It returns an AWSResourceReport struct that contains any non-fatal errors that occurred during the execution of the subcommand.\n\n```go\ntype IamResourceReport struct {\n\tInlinePolicies   []*iam.GetRolePolicyOutput `json:\"inlinePolicies\" yaml:\"inlinePolicies\"`\n\tAttachedPolicies []identity.PolicyResource  `json:\"attachedPolicies\" yaml:\"attachedPolicies\"`\n\tRole             *types.Role                `json:\"role\" yaml:\"role\"`\n\tErrors           []string                   `json:\"errors\" yaml:\"errors\"`\n}\n```\nIamResourceReport represents the output of the \\`methodaws current iam\\` subcommand. It contains the inline policies, attached policies, and role details of the current IAM role. It also contains any errors that occurred during the execution of the subcommand.\n\n```go\nfunc IamDetails(ctx context.Context, cfg aws.Config) (IamResourceReport, error)\n```\nIamDetails is responsible for gathering the IAM role details, inline policies, and attached policies for any IAM roles that are associated with the current AWS instance. It returns an IamResourceReport struct that contains any non-fatal errors that occurred during the execution of the subcommand. If the caller ARN cannot be retrieved, it will return an error because execution cannot proceed.\n\n","path":"github.com/Method-Security/methodaws/internal/current","name":"current","synopsis":"Package current contains all logic and data structures relevant to the current state of the AWS instance.","isRedistributable":true}
