Skip to content

Commit

Permalink
add IRSA credential type
Browse files Browse the repository at this point in the history
  • Loading branch information
nithyatsu committed Jun 21, 2024
1 parent 0b6ecc0 commit 39d22b7
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/ucp/api/v20231001preview/zz_generated_constants.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/ucp/api/v20231001preview/zz_generated_interfaces.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions pkg/ucp/api/v20231001preview/zz_generated_models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions pkg/ucp/api/v20231001preview/zz_generated_models_serde.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,8 @@
"type": "string",
"description": "AWS credential kind",
"enum": [
"AccessKey"
"AccessKey",
"IRSA"
],
"x-ms-enum": {
"name": "AWSCredentialKind",
Expand All @@ -1659,6 +1660,11 @@
"name": "AccessKey",
"value": "AccessKey",
"description": "The AWS Access Key credential"
},
{
"name": "IRSA",
"value": "IRSA",
"description": "The AWS IRSA credential"
}
]
}
Expand Down Expand Up @@ -1772,6 +1778,32 @@
}
}
},
"AwsIRSACredentialProperties": {
"type": "object",
"description": "AWS credential storage properties",
"properties": {
"roleARN": {
"type": "string",
"format": "password",
"description": "RoleARN for AWS IRSA identity",
"x-ms-secret": true
},
"storage": {
"$ref": "#/definitions/CredentialStorageProperties",
"description": "The storage properties"
}
},
"required": [
"roleARN",
"storage"
],
"allOf": [
{
"$ref": "#/definitions/AwsCredentialProperties"
}
],
"x-ms-discriminator-value": "IRSA"
},
"AwsPlaneResource": {
"type": "object",
"description": "The AWS plane resource",
Expand Down
16 changes: 16 additions & 0 deletions typespec/UCP/aws-credentials.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ model AwsPlaneNameParameter {
enum AWSCredentialKind {
@doc("The AWS Access Key credential")
AccessKey,
@doc("The AWS IRSA credential")
IRSA,

}

@discriminator("kind")
Expand Down Expand Up @@ -93,6 +96,19 @@ model AwsAccessKeyCredentialProperties extends AwsCredentialProperties {
storage: CredentialStorageProperties;
}

@doc("AWS credential storage properties")
model AwsIRSACredentialProperties extends AwsCredentialProperties {
@doc("Access Key kind")
kind: AWSCredentialKind.IRSA;

@doc("RoleARN for AWS IRSA identity")
@secret
roleARN: string;

@doc("The storage properties")
storage: CredentialStorageProperties;
}

alias AwsCredentialBaseParameter<TResource> = CredentialBaseParameters<
TResource,
AwsPlaneNameParameter
Expand Down

0 comments on commit 39d22b7

Please sign in to comment.