Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/accounts/account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type AccountResource struct {
Name string `json:"Name" validate:"required,notall"`
PrivateKeyFile *core.SensitiveValue `json:"PrivateKeyFile,omitempty"`
PrivateKeyPassphrase *core.SensitiveValue `json:"PrivateKeyPassphrase,omitempty"`
Region string `json:"Region,omitempty"`
ResourceManagerEndpoint string `json:"ResourceManagementEndpointBaseUri,omitempty"`
SecretKey *core.SensitiveValue `json:"SecretKey,omitempty"`
Slug string `json:"Slug,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions pkg/accounts/account_utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func ToAccount(accountResource *AccountResource) (IAccount, error) {
if err != nil {
return nil, err
}
amazonWebServicesAccount.Region = accountResource.Region
account = amazonWebServicesAccount
case AccountTypeAwsOIDC:
awsOIDCAccount, err := NewAwsOIDCAccount(accountResource.GetName(), accountResource.RoleArn)
Expand All @@ -31,6 +32,7 @@ func ToAccount(accountResource *AccountResource) (IAccount, error) {
}
awsOIDCAccount.RoleArn = accountResource.RoleArn
awsOIDCAccount.SessionDuration = accountResource.SessionDuration
awsOIDCAccount.Region = accountResource.Region
awsOIDCAccount.Audience = accountResource.Audience
awsOIDCAccount.DeploymentSubjectKeys = accountResource.DeploymentSubjectKeys
awsOIDCAccount.AccountTestSubjectKeys = accountResource.AccountTestSubjectKeys
Expand Down Expand Up @@ -149,10 +151,12 @@ func ToAccountResource(account IAccount) (*AccountResource, error) {
amazonWebServicesAccount := account.(*AmazonWebServicesAccount)
accountResource.AccessKey = amazonWebServicesAccount.AccessKey
accountResource.SecretKey = amazonWebServicesAccount.SecretKey
accountResource.Region = amazonWebServicesAccount.Region
case AccountTypeAwsOIDC:
awsOIDCAccount := account.(*AwsOIDCAccount)
accountResource.RoleArn = awsOIDCAccount.RoleArn
accountResource.SessionDuration = awsOIDCAccount.SessionDuration
accountResource.Region = awsOIDCAccount.Region
accountResource.Audience = awsOIDCAccount.Audience
accountResource.DeploymentSubjectKeys = awsOIDCAccount.DeploymentSubjectKeys
accountResource.AccountTestSubjectKeys = awsOIDCAccount.AccountTestSubjectKeys
Expand Down
1 change: 1 addition & 0 deletions pkg/accounts/amazon_web_services_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
type AmazonWebServicesAccount struct {
AccessKey string `json:"AccessKey" validate:"required"`
SecretKey *core.SensitiveValue `json:"SecretKey" validate:"required"`
Region string `json:"Region,omitempty"`

account
}
Expand Down
1 change: 1 addition & 0 deletions pkg/accounts/aws_oidc_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
type AwsOIDCAccount struct {
RoleArn string `json:"RoleArn"`
SessionDuration string `json:"SessionDuration,omitempty"`
Region string `json:"Region,omitempty"`
Audience string `json:"Audience,omitempty"`
DeploymentSubjectKeys []string `json:"DeploymentSubjectKeys,omitempty" validate:"omitempty,dive,oneof=space environment project tenant runbook account type'"`
HealthCheckSubjectKeys []string `json:"HealthCheckSubjectKeys,omitempty" validate:"omitempty,dive,oneof=space account target type'"`
Expand Down
Loading