Creates a workload identity template under a workload identity provider.
The operation accepts two mutually exclusive modes, and the member you supply decides which one you are in. TemplateDefinition puts the request in template definition mode, and PathPattern puts it in direct authoring mode.
Use template definition mode when a service-owned definition already covers the workload you are onboarding. IAM then renders the pattern and the attestation policy for you, so there is less to get wrong. Use direct authoring mode when no definition covers your case, or when you need a pattern or an attestation policy that the available definitions do not offer.
TemplateDefinition and supply only the values that definition leaves open. WorkloadIdentityTemplateDefinitionType carries which values a given definition leaves open and the name it gives each one. IAM renders PathPattern and AttestationPolicy from the definition, so you author neither. In this mode, Tags is the only other request parameter you can supply.Name , WorkloadIdentityProviderArn and PathPattern yourself, and you can supply Description , PathPrefix , AttestationPolicy and Tags .Because the two modes make different members mandatory, no member of this request is unconditionally required, and every parameter below therefore reads Required: No . The per-mode rules are what govern. TemplateDefinition is required in template definition mode and forbidden in direct authoring mode. Name , WorkloadIdentityProviderArn and PathPattern are required in direct authoring mode and forbidden in template definition mode, where IAM renders all three from the definition.
AttestationPolicyis optional on this operation. A policy supplied here is equivalent to one supplied later by PutWorkloadIdentityTemplateAttestationPolicy , and a template created without one admits nothing until a policy is set.
See also: AWS API Documentation
create-workload-identity-template
[--name <value>]
[--description <value>]
[--resource-scope <value>]
[--workload-identity-provider-arn <value>]
[--path-prefix <value>]
[--path-pattern <value>]
[--attestation-policy <value>]
[--tags <value>]
[--template-definition <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
--name (string)
The name of the template. It is the leaf of the template’s own resource ARN and it does not appear in any rendered identifier.
Required in direct authoring mode, and forbidden in template definition mode.
Constraints:
- min:
1- max:
128- pattern:
^[A-Za-z0-9_-]+$
--description (string)
A description of the template. If you omit it, the template carries no description and responses omit the
Descriptionelement.Forbidden in template definition mode.
Constraints:
- min:
0- max:
1000- pattern:
^[\u0009\u000A\u000D\u0020-\u007E\u00A1-\u00FF]*$
--resource-scope (string)
The scope the template is created at. An
ORGANIZATION-scoped template belongs to your organization. If you do not include this parameter, it defaults toACCOUNT.An
ORGANIZATION-scoped template must reference an organization-scoped provider. AnACCOUNT-scoped template can reference an account-scoped provider in your account or an organization-scoped provider in your organization.Forbidden in template definition mode.
Possible values:
ACCOUNTORGANIZATION
--workload-identity-provider-arn (string)
The Amazon Resource Name (ARN) of the workload identity provider to create the template under.
Required in direct authoring mode, and forbidden in template definition mode, where the service renders it from the definition.
Constraints:
- min:
20- max:
2048
--path-prefix (string)
The namespace between the provider’s naming root and the rendered pattern. Segments only, with no leading slash, no trailing slash and no empty segment.
Forbidden in template definition mode.
Constraints:
- min:
1- max:
64- pattern:
^(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+(?:/(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+)*$
--path-pattern (string)
The pattern that workload identifiers are rendered from. For the pattern grammar, and for the checks the regular expression cannot express, see WorkloadIdentityTemplatePathPatternType .
Required in direct authoring mode, and forbidden in template definition mode, where the service renders it from the definition.
Constraints:
- min:
3- max:
16384- pattern:
^(?=.*\{)(?:\{[A-Za-z0-9:/._-]+\}|(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+)(?:/(?:\{[A-Za-z0-9:/._-]+\}|(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+))*$
--attestation-policy (string)
The attestation policy that decides which workloads can be attested through the template. A policy supplied here is equivalent to one supplied later by PutWorkloadIdentityTemplateAttestationPolicy .
Forbidden in template definition mode, where the service renders the policy from the definition.
Constraints:
- min:
1- max:
131072- pattern:
[\u0009\u000A\u000D\u0020-\u00FF]+
--tags (list)
A list of tags that you want to attach to the new template. Each tag consists of a key name and an associated value. Tag keys are case sensitive, and two tag keys that differ only in case are rejected with
InvalidInputException. For more information about tagging, see Tagging IAM resources in the IAM User Guide .Tagsis accepted in both modes. A template definition never carries tags of its own.Note
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.Constraints:
- max:
50(structure)
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key -> (string) [required]
The key name that can be used to look up or retrieve the associated value. For example,
DepartmentorCost Centerare common choices.Constraints:
- min:
1- max:
128- pattern:
[\p{L}\p{Z}\p{N}_.:/=+\-@]+Value -> (string) [required]
The value associated with this tag. For example, tags with a key name of
Departmentcould have values such asHuman Resources,Accounting, andSupport. Tags with a key name ofCost Centermight have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.Constraints:
- min:
0- max:
256- pattern:
[\p{L}\p{Z}\p{N}_.:/=+\-@]*
Shorthand Syntax:
Key=string,Value=string ...
JSON Syntax:
[
{
"Key": "string",
"Value": "string"
}
...
]
--template-definition (structure)
The service-owned definition to render the template from, carrying only the values that definition leaves open. For the values a definition leaves open and the name of each, see WorkloadIdentityTemplateDefinitionType .
Supplying this parameter selects template definition mode. It is forbidden in direct authoring mode.
TemplateDefinitionArn -> (string) [required]
The Amazon Resource Name (ARN) of the service-owned template definition to render from.
Constraints:
- min:
20- max:
2048ReplacementValues -> (map)
The values the definition leaves open, keyed by the name the definition gives each one.
Constraints:
- max:
30key -> (string)
value -> (structure)
Contains one entry of the
ReplacementValuesmap of a WorkloadIdentityTemplateDefinitionType object.Values -> (list) [required]
The values this entry supplies to the template definition.
The value is a list rather than a single string because a policy condition routinely takes several values.
Constraints:
- min:
1- max:
20(string)
JSON Syntax:
{
"TemplateDefinitionArn": "string",
"ReplacementValues": {"string": {
"Values": ["string", ...]
}
...}
}
--cli-input-json | --cli-input-yaml (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.
--generate-cli-skeleton (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
--debug (boolean)
Turn on debug logging.
--endpoint-url (string)
Override command’s default URL with the given URL.
--no-verify-ssl (boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate (boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output (string)
The formatting style for command output.
--query (string)
A JMESPath query to use in filtering the response data.
--profile (string)
Use a specific profile from your credential file.
--region (string)
The region to use. Overrides config/env settings.
--version (string)
Display the version of this tool.
--color (string)
Turn on/off color output.
--no-sign-request (boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle (string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout (int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout (int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format (string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.
--no-cli-pager (boolean)
Disable cli pager for output.
--cli-auto-prompt (boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt (boolean)
Disable automatically prompt for CLI input parameters.
--cli-error-format (string)
The formatting style for error output. By default, errors are displayed in enhanced format.
--help (boolean)
Display help for the command/subcommand.
Name -> (string)
The name of the template. In template definition mode, the service renders it from the definition.
Constraints:
- min:
1- max:
128- pattern:
^[A-Za-z0-9_-]+$
TemplateId -> (string)
The template’s immutable identifier, which is distinct from its ARN. IAM prefixes it with
AWTAfor an account-scoped template andAWTOfor an organization-scoped template. A template that is deleted and recreated under the same name keeps the ARN but gets a new identifier.Constraints:
- min:
16- max:
128- pattern:
[\w]+
Description -> (string)
The description of the template. Omitted when none was supplied.
Constraints:
- min:
0- max:
1000- pattern:
^[\u0009\u000A\u000D\u0020-\u007E\u00A1-\u00FF]*$
ResourceScope -> (string)
The resolved scope, so you learn which scope applied even when you omitted the parameter.
Possible values:
ACCOUNTORGANIZATION
Arn -> (string)
The template’s own Amazon Resource Name (ARN).
Nameis its leaf. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .For an
ORGANIZATION-scoped template, the account segment of the ARN is the organization ID, for examplearn:aws:iam::o-abc123def4:workload-identity-template/PaymentsFleet.Constraints:
- min:
20- max:
2048
WorkloadIdentityProviderArn -> (string)
The Amazon Resource Name (ARN) of the provider the template was created under. In template definition mode, the service renders it from the definition.
Constraints:
- min:
20- max:
2048
PathPrefix -> (string)
The namespace the pattern sits under. Omitted when none was supplied.
Constraints:
- min:
1- max:
64- pattern:
^(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+(?:/(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+)*$
PathPattern -> (string)
The pattern that workload identifiers are rendered from.
Constraints:
- min:
3- max:
16384- pattern:
^(?=.*\{)(?:\{[A-Za-z0-9:/._-]+\}|(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+)(?:/(?:\{[A-Za-z0-9:/._-]+\}|(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+))*$
AttestationPolicy -> (string)
The attestation policy set by this call. Echoed when a policy was set by this call, and omitted otherwise.
Constraints:
- min:
1- max:
131072- pattern:
[\u0009\u000A\u000D\u0020-\u00FF]+
Tags -> (list)
The tags attached to the template. Omitted when no tags were supplied. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Constraints:
- max:
50(structure)
A structure that represents user-provided metadata that can be associated with an IAM resource. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
Key -> (string) [required]
The key name that can be used to look up or retrieve the associated value. For example,
DepartmentorCost Centerare common choices.Constraints:
- min:
1- max:
128- pattern:
[\p{L}\p{Z}\p{N}_.:/=+\-@]+Value -> (string) [required]
The value associated with this tag. For example, tags with a key name of
Departmentcould have values such asHuman Resources,Accounting, andSupport. Tags with a key name ofCost Centermight have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.Constraints:
- min:
0- max:
256- pattern:
[\p{L}\p{Z}\p{N}_.:/=+\-@]*
CreateDate -> (timestamp)
The date and time, in ISO 8601 date-time format, when the template was created.