Documentation
¶
Overview ¶
Package awscloud is the cloud as AWS answers it, the release build's driver of cloud.Cloud.
A named profile's clients are built field by field from the AWS config and credentials files under the home folder, never through the SDK's config loader, which reads the environment: so no credential, profile, config-file, role, container or endpoint variable changes what they reach (spec 6.2.2). They do use the HTTP proxy the environment names, and the CA bundle Config names, or else the profile's own, which corporate networks need (see package cloud).
The write-access check reads, with the everyday credentials, sts:GetCallerIdentity, iam:ListRoles, iam:GetRole and iam:SimulatePrincipalPolicy, all of which the AWS managed ReadOnlyAccess policy grants; any it's denied makes the answer unknown. It lists each cached sign-in's permission sets with sso:ListAccountRoles, which that sign-in's own token authorises, and renews an expired one with sso-oidc:CreateToken, which rewrites that sign-in's cache file, as the AWS CLI does.
Index ¶
- type AWS
- func (a *AWS) Identity(ctx context.Context, c cloud.Credentials) (cloud.Identity, error)
- func (a *AWS) Profile(ctx context.Context, name config.ProfileName) (cloud.Profile, bool, error)
- func (a *AWS) StartSignIn(ctx context.Context, name config.ProfileName) (cloud.DeviceSignIn, error)
- func (a *AWS) WriteAccess(ctx context.Context, q cloud.WriteAccessQuery) (cloud.WriteAccess, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWS ¶
type AWS struct {
// contains filtered or unexported fields
}
AWS is the cloud as AWS answers it.
func (*AWS) Identity ¶
Identity asks STS's GetCallerIdentity, of the credentials and, where they assume roles, of their chain's base.
func (*AWS) StartSignIn ¶
func (a *AWS) StartSignIn(ctx context.Context, name config.ProfileName) (cloud.DeviceSignIn, error)
StartSignIn registers terrace with the profile's Identity Center as a public client and starts a device authorisation there, as the AWS CLI's sign-in with a device code does. The profile must be a sign-in of its own (cloud.Profile.OwnSignIn): its credentials are its permission set's own.
func (*AWS) WriteAccess ¶
func (a *AWS) WriteAccess(ctx context.Context, q cloud.WriteAccessQuery) (cloud.WriteAccess, error)
WriteAccess asks IAM's policy simulator (iam:SimulatePrincipalPolicy) whether the principals the everyday credentials can act as in the account are allowed a delete action, as package cloud's doc says. The principals are each link of the credentials' chain in the account, found with sts:GetCallerIdentity and iam:GetRole, and the role of every permission set each live cached Identity Center sign-in reaches there (sso:ListAccountRoles, then iam:ListRoles). Each is simulated with no region, and in the region the profile or the environment names.