Skip to content

Commit

Permalink
workflow working
Browse files Browse the repository at this point in the history
  • Loading branch information
rouralberto committed Nov 20, 2019
1 parent dcc6a47 commit 9f5cc63
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.es-ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Puedes crear repositorios simplemente con proporcionar una lista de strings con
| cr_access_key | El AccessKey para el namespace de CR |
| cr_endpoint | Dominio público del Registro de Contenedores |
| repository_ids | Lista de posibles repositorios creados |
| ram_console_username | Username para la consola |
| disposable_password | Contraseña temporal para activar el usuario en la consola, fuerza a resetearla |


Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ You can create repositories by populating the `repositories` variable with a lis
| cr_access_key | The CR Namespace's Access Key |
| cr_endpoint | Public endpoint of the registry |
| repository_ids | List of repository IDs created |
| ram_console_username | Console login username |
| disposable_password | Password to activate the console login profile, forces to reset it |


Expand Down
5 changes: 5 additions & 0 deletions examples/basic/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ output "cr_access_key" {
value = module.cr.cr_access_key
}

output "ram_console_username" {
description = "Console login username"
value = module.cr.ram_console_username
}

output "cr_endpoint" {
description = "Public endpoint of the registry"
value = module.cr.cr_endpoint
Expand Down
12 changes: 11 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ locals {
cr_resource_prefix = "acs:cr:${data.alicloud_regions.current.regions.0.id}:${data.alicloud_account.current.id}:repository/${var.namespace}"
}

resource "random_password" "cr_console_password" {
resource "random_string" "cr_console_password" {
length = 12
special = false
}
Expand Down Expand Up @@ -52,6 +52,11 @@ resource "alicloud_ram_policy" "cr_namespace_policy" {
"${local.cr_resource_prefix}",
"${local.cr_resource_prefix}/*"
]
},
{
"Action" = "cr:GetAuthorizationToken",
"Effect" = "Allow",
"Resource" = "*"
}
]
"Version" = "1"
Expand All @@ -71,6 +76,11 @@ resource "alicloud_ram_login_profile" "namespace_console_user" {
user_name = alicloud_ram_user.namespace_user.name
password = random_string.cr_console_password.result
password_reset_required = true
lifecycle {
ignore_changes = [
password_reset_required
]
}
}

resource "alicloud_ram_user_policy_attachment" "cr_user_policy_attachment" {
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ output "cr_access_key" {
value = alicloud_ram_access_key.cr_ak.id
}

output "ram_console_username" {
description = "Console login username"
value = "${alicloud_ram_login_profile.namespace_console_user.user_name}@${data.alicloud_account.current.id}.onaliyun.com"
}

output "cr_endpoint" {
description = "Public endpoint of the registry"
value = alicloud_cr_repo.namespace_repositories.0.domain_list.public
Expand Down

0 comments on commit 9f5cc63

Please sign in to comment.