UNPKG

cdk-iam-floyd

Version:

AWS IAM policy statement generator with fluent interface for AWS CDK

1,075 lines 273 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Sts = void 0; const shared_1 = require("../../shared"); /** * Statement provider for service [sts](https://docs.aws.amazon.com/service-authorization/latest/reference/list_sts.html). * * @param sid [SID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html) of the statement */ class Sts extends shared_1.PolicyStatement { /** * Grants permission to obtain a set of temporary security credentials that you can use to access AWS resources that you might not normally have access to * * Access Level: Write * * https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html */ toAssumeRole() { return this.to('AssumeRole'); } /** * Grants permission to obtain a set of temporary security credentials for users who have been authenticated via a SAML authentication response * * Access Level: Write * * https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithSAML.html */ toAssumeRoleWithSAML() { return this.to('AssumeRoleWithSAML'); } /** * Grants permission to obtain a set of temporary security credentials for users who have been authenticated in a mobile or web application with a web identity provider * * Access Level: Write * * https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html */ toAssumeRoleWithWebIdentity() { return this.to('AssumeRoleWithWebIdentity'); } /** * Grants permission to obtain a set of temporary security credentials that you can use to perform privileged tasks in member accounts in your organization * * Access Level: Write * * https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoot.html */ toAssumeRoot() { return this.to('AssumeRoot'); } /** * Grants permission to decode additional information about the authorization status of a request from an encoded message returned in response to an AWS request * * Access Level: Write * * https://docs.aws.amazon.com/STS/latest/APIReference/API_DecodeAuthorizationMessage.html */ toDecodeAuthorizationMessage() { return this.to('DecodeAuthorizationMessage'); } /** * Grants permission to obtain details about the access key id passed as a parameter to the request * * Access Level: Read * * https://docs.aws.amazon.com/STS/latest/APIReference/API_GetAccessKeyInfo.html */ toGetAccessKeyInfo() { return this.to('GetAccessKeyInfo'); } /** * Grants permission to obtain details about the IAM identity whose credentials are used to call the API * * Access Level: Read * * https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html */ toGetCallerIdentity() { return this.to('GetCallerIdentity'); } /** * Returns temporary security credentials for accessing an AWS account after temporary delegation request approval. This API requires the tradeInToken provided upon request delegation approval and is intended to be used only by Amazon or AWS Partners * * Access Level: Write * * https://docs.aws.amazon.com/STS/latest/APIReference/API_GetDelegatedAccessToken.html */ toGetDelegatedAccessToken() { return this.to('GetDelegatedAccessToken'); } /** * Grants permission to obtain a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a federated user * * Access Level: Write * * https://docs.aws.amazon.com/STS/latest/APIReference/API_GetFederationToken.html */ toGetFederationToken() { return this.to('GetFederationToken'); } /** * Grants permission to obtain a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for an AWS account or IAM user * * Access Level: Read * * https://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html */ toGetSessionToken() { return this.to('GetSessionToken'); } /** * Grants permission to obtain a short-lived, publicly verifiable JSON Web Token (JWT) that represents the calling IAM principal's identity * * Access Level: Write * * Possible conditions: * - .ifAwsRequestTag() * - .ifAwsTagKeys() * - .ifDurationSeconds() * - .ifIdentityTokenAudience() * - .ifSigningAlgorithm() * * https://docs.aws.amazon.com/STS/latest/APIReference/API_GetWebIdentityToken.html */ toGetWebIdentityToken() { return this.to('GetWebIdentityToken'); } /** * Grants permission to obtain a STS bearer token for an AWS root user, IAM role, or an IAM user * * Access Level: Read * * Possible conditions: * - .ifAWSServiceName() * - .ifDurationSeconds() * * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_bearer.html */ toGetServiceBearerToken() { return this.to('GetServiceBearerToken'); } /** * Grants permission to set context keys on a STS session * * Access Level: Write * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-sts */ toSetContext() { return this.to('SetContext'); } /** * Grants permission to set a source identity on a STS session * * Access Level: Write * * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html#id_credentials_temp_control-access_monitor-perms */ toSetSourceIdentity() { return this.to('SetSourceIdentity'); } /** * Grants permission to add tags to the JSON Web Token (JWT) generated by the GetWebIdentityToken API * * Access Level: Tagging, Write * * Possible conditions: * - .ifAwsRequestTag() * - .ifAwsTagKeys() * * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_web_identity_token_tags.html */ toTagGetWebIdentityToken() { return this.to('TagGetWebIdentityToken'); } /** * Grants permission to add tags to a STS session * * Access Level: Tagging, Write * * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html */ toTagSession() { return this.to('TagSession'); } /** * Adds a resource of type context-provider to the statement * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns * * @param contextProviderName - Identifier for the contextProviderName. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. */ onContextProvider(contextProviderName, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:iam::aws:contextProvider/${contextProviderName}`); } /** * Adds a resource of type federated-user to the statement * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns * * @param federatedUserName - Identifier for the federatedUserName. * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. */ onFederatedUser(federatedUserName, account, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:sts::${account ?? this.defaultAccount}:federated-user/${federatedUserName}`); } /** * Adds a resource of type role to the statement * * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html * * @param roleNameWithPath - Identifier for the roleNameWithPath. * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. * * Possible conditions: * - .ifAwsResourceTag() * - .ifIamResourceTag() */ onRole(roleNameWithPath, account, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:iam::${account ?? this.defaultAccount}:role/${roleNameWithPath}`); } /** * Adds a resource of type root-user to the statement * * https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html * * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. */ onRootUser(account, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:iam::${account ?? this.defaultAccount}:root`); } /** * Adds a resource of type self-session to the statement * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns * * @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account. * @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition. */ onSelfSession(account, partition) { return this.on(`arn:${partition ?? this.defaultPartition}:sts::${account ?? this.defaultAccount}:self`); } /** * Filters access by the Google application ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_aud * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGoogleAud(value, operator) { return this.if(`accounts.google.com:aud`, value, operator ?? 'StringLike'); } /** * Filters access by the Google Cloud or Google Workspace organization number * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [numeric operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_Numeric). **Default:** `NumericEquals` */ ifGoogleGoogleOrganizationNumber(value, operator) { return this.if(`accounts.google.com:google/organization_number`, value, operator ?? 'NumericEquals'); } /** * Filters access by the Google audience * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_oaud * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGoogleOaud(value, operator) { return this.if(`accounts.google.com:oaud`, value, operator ?? 'StringLike'); } /** * Filters access by the subject of the claim (the Google user ID) * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_sub * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGoogleSub(value, operator) { return this.if(`accounts.google.com:sub`, value, operator ?? 'StringLike'); } /** * Filters access by the git branch that triggered the Buildkite build * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteDevBuildBranch(value, operator) { return this.if(`agent.\${Domain}.buildkite.dev:build_branch`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite cluster ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteDevClusterId(value, operator) { return this.if(`agent.\${Domain}.buildkite.dev:cluster_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite cluster name * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteDevClusterName(value, operator) { return this.if(`agent.\${Domain}.buildkite.dev:cluster_name`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite organization ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteDevOrganizationId(value, operator) { return this.if(`agent.\${Domain}.buildkite.dev:organization_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite organization slug * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteDevOrganizationSlug(value, operator) { return this.if(`agent.\${Domain}.buildkite.dev:organization_slug`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite pipeline ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteDevPipelineId(value, operator) { return this.if(`agent.\${Domain}.buildkite.dev:pipeline_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite pipeline slug * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteDevPipelineSlug(value, operator) { return this.if(`agent.\${Domain}.buildkite.dev:pipeline_slug`, value, operator ?? 'StringLike'); } /** * Filters access by the git branch that triggered the Buildkite build * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteSiteBuildBranch(value, operator) { return this.if(`agent.\${Domain}.buildkite.site:build_branch`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite cluster ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteSiteClusterId(value, operator) { return this.if(`agent.\${Domain}.buildkite.site:cluster_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite cluster name * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteSiteClusterName(value, operator) { return this.if(`agent.\${Domain}.buildkite.site:cluster_name`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite organization ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteSiteOrganizationId(value, operator) { return this.if(`agent.\${Domain}.buildkite.site:organization_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite organization slug * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteSiteOrganizationSlug(value, operator) { return this.if(`agent.\${Domain}.buildkite.site:organization_slug`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite pipeline ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteSitePipelineId(value, operator) { return this.if(`agent.\${Domain}.buildkite.site:pipeline_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite pipeline slug * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentDomainBuildkiteSitePipelineSlug(value, operator) { return this.if(`agent.\${Domain}.buildkite.site:pipeline_slug`, value, operator ?? 'StringLike'); } /** * Filters access by the git branch that triggered the Buildkite build * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentBuildkiteComBuildBranch(value, operator) { return this.if(`agent.buildkite.com:build_branch`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite cluster ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentBuildkiteComClusterId(value, operator) { return this.if(`agent.buildkite.com:cluster_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite cluster name * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentBuildkiteComClusterName(value, operator) { return this.if(`agent.buildkite.com:cluster_name`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite organization ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentBuildkiteComOrganizationId(value, operator) { return this.if(`agent.buildkite.com:organization_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite organization slug * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentBuildkiteComOrganizationSlug(value, operator) { return this.if(`agent.buildkite.com:organization_slug`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite pipeline ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentBuildkiteComPipelineId(value, operator) { return this.if(`agent.buildkite.com:pipeline_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Buildkite pipeline slug * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAgentBuildkiteComPipelineSlug(value, operator) { return this.if(`agent.buildkite.com:pipeline_slug`, value, operator ?? 'StringLike'); } /** * Filters access by the tags that are passed in the request * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithSAML() * - .toAssumeRoleWithWebIdentity() * - .toGetFederationToken() * - .toGetWebIdentityToken() * - .toTagGetWebIdentityToken() * - .toTagSession() * * @param tagKey The tag key to check * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAwsRequestTag(tagKey, value, operator) { return this.if(`aws:RequestTag/${tagKey}`, value, operator ?? 'StringLike'); } /** * Filters access by the tags associated with the resource * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithSAML() * - .toAssumeRoleWithWebIdentity() * - .toSetContext() * - .toSetSourceIdentity() * - .toTagSession() * * Applies to resource types: * - role * * @param tagKey The tag key to check * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAwsResourceTag(tagKey, value, operator) { return this.if(`aws:ResourceTag/${tagKey}`, value, operator ?? 'StringLike'); } /** * Filters access by the tag keys that are passed in the request * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithSAML() * - .toAssumeRoleWithWebIdentity() * - .toGetFederationToken() * - .toGetWebIdentityToken() * - .toTagGetWebIdentityToken() * - .toTagSession() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifAwsTagKeys(value, operator) { return this.if(`aws:TagKeys`, value, operator ?? 'StringLike'); } /** * Filters access by the login information for Amazon Cognito * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_amr * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifCognitoAmr(value, operator) { return this.if(`cognito-identity.amazonaws.com:amr`, value, operator ?? 'StringLike'); } /** * Filters access by the Amazon Cognito identity pool ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_aud * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifCognitoAud(value, operator) { return this.if(`cognito-identity.amazonaws.com:aud`, value, operator ?? 'StringLike'); } /** * Filters access by the subject of the claim (the Amazon Cognito user ID) * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_sub * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifCognitoSub(value, operator) { return this.if(`cognito-identity.amazonaws.com:sub`, value, operator ?? 'StringLike'); } /** * Filters access by the personal account that initiated the workflow run * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameActor(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:actor`, value, operator ?? 'StringLike'); } /** * Filters access by the ID of the personal account that initiated the workflow run * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameActorId(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:actor_id`, value, operator ?? 'StringLike'); } /** * Filters access by the ID of the enterprise that contains the repository from where the workflow is running * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameEnterpriseId(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:enterprise_id`, value, operator ?? 'StringLike'); } /** * Filters access by the name of the environment used by the job * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameEnvironment(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:environment`, value, operator ?? 'StringLike'); } /** * Filters access by the reference path to the reusable workflow for jobs using a reusable workflow * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameJobWorkflowRef(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:job_workflow_ref`, value, operator ?? 'StringLike'); } /** * Filters access by the git ref (branch or tag) that triggered the workflow run * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameRef(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:ref`, value, operator ?? 'StringLike'); } /** * Filters access by the repository from where the workflow is running * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameRepository(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:repository`, value, operator ?? 'StringLike'); } /** * Filters access by the ID of the repository from where the workflow is running * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameRepositoryId(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:repository_id`, value, operator ?? 'StringLike'); } /** * Filters access by the ID of the repository owner from where the workflow is running * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameRepositoryOwnerId(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:repository_owner_id`, value, operator ?? 'StringLike'); } /** * Filters access by the name of the workflow * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGithubComEnterprisesEnterpriseNameWorkflow(value, operator) { return this.if(`github.com/enterprises/\${EnterpriseName}:workflow`, value, operator ?? 'StringLike'); } /** * Filters access by the GitLab namespace (group) ID of the project running the CI/CD job * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComNamespaceId(value, operator) { return this.if(`gitlab.com:namespace_id`, value, operator ?? 'StringLike'); } /** * Filters access by the source that triggered the GitLab pipeline * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComPipelineSource(value, operator) { return this.if(`gitlab.com:pipeline_source`, value, operator ?? 'StringLike'); } /** * Filters access by the GitLab project ID running the CI/CD job * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComProjectId(value, operator) { return this.if(`gitlab.com:project_id`, value, operator ?? 'StringLike'); } /** * Filters access by whether the GitLab git ref that triggered the job is protected * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComRefProtected(value, operator) { return this.if(`gitlab.com:ref_protected`, value, operator ?? 'StringLike'); } /** * Filters access by the GitLab runner environment for the CI/CD job * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComRunnerEnvironment(value, operator) { return this.if(`gitlab.com:runner_environment`, value, operator ?? 'StringLike'); } /** * Filters access by the GitLab user access level within the project * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComUserAccessLevel(value, operator) { return this.if(`gitlab.com:user_access_level`, value, operator ?? 'StringLike'); } /** * Filters access by the GitLab user email executing the CI/CD job * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComUserEmail(value, operator) { return this.if(`gitlab.com:user_email`, value, operator ?? 'StringLike'); } /** * Filters access by the GitLab user ID executing the CI/CD job * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComUserId(value, operator) { return this.if(`gitlab.com:user_id`, value, operator ?? 'StringLike'); } /** * Filters access by the GitLab username executing the CI/CD job * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifGitlabComUserLogin(value, operator) { return this.if(`gitlab.com:user_login`, value, operator ?? 'StringLike'); } /** * Filters access by the Facebook application ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_id * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifFacebookAppId(value, operator) { return this.if(`graph.facebook.com:app_id`, value, operator ?? 'StringLike'); } /** * Filters access by the Facebook user ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_id * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifFacebookId(value, operator) { return this.if(`graph.facebook.com:id`, value, operator ?? 'StringLike'); } /** * Filters access by the tags that are attached to the role that is being assumed * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_ResourceTag * * Applies to actions: * - .toAssumeRole() * - .toAssumeRoleWithSAML() * - .toAssumeRoleWithWebIdentity() * - .toSetContext() * - .toSetSourceIdentity() * - .toTagSession() * * Applies to resource types: * - role * * @param tagKey The tag key to check * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifIamResourceTag(tagKey, value, operator) { return this.if(`iam:ResourceTag/${tagKey}`, value, operator ?? 'StringLike'); } /** * Filters access by the OCI resource principal session token ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifIdcsOciUniqueIdentifierIdentityOraclecloudComRpstId(value, operator) { return this.if(`idcs-\${OciUniqueIdentifier}.identity.oraclecloud.com:rpst_id`, value, operator ?? 'StringLike'); } /** * Filters access by the CircleCI project ID * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#condition-keys-wif * * Applies to actions: * - .toAssumeRoleWithWebIdentity() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifOidcCircleciComOrgOrgIdOidcCircleciComProjectId(value, operator) { return this.if(`oidc.circleci.com/org/\${OrgId}:oidc.circleci.com/project-id`, value, operator ?? 'StringLike'); } /** * Filters access by the endpoint URL to which SAML assertions are presented * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_aud * * Applies to actions: * - .toAssumeRoleWithSAML() * - .toTagSession() * * @param value The value(s) to check * @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike` */ ifSamlAud(value, operator) { return this.if(`saml:aud`, value, operator ?? 'StringLike'); } /** * Filters access by the eduOrg attribute * * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_cn * * Applies