Access - Create Access Keys
Aim
In this demo, we'll be creating some access keys. They are the preferred way to authenticate to Piranha using client software.
Instructions
Web Console
Log in to the web console, in the Services menu, click on Access. List users
Ansible
You can see complete commands with output here Ansible Output
$ cd ansible/
$ ansible-playbook playbook.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Collection community.aws does not support Ansible version 2.10.8
PLAY [Access - Create Access Keys] ****************************************************************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [Create a new access key] ********************************************************************************************************************************************************************************************
[WARNING]: Collection amazon.aws does not support Ansible version 2.10.8
changed: [localhost]
TASK [Show AKID from the generated Key] ***********************************************************************************************************************************************************************************
ok: [localhost] => {
"msg": "AKID: AKIA****************"
}
TASK [Show secret from the generated Key] *********************************************************************************************************************************************************************************
ok: [localhost] => {
"msg": "SECRET: *******************************"
}
PLAY RECAP ****************************************************************************************************************************************************************************************************************
localhost : ok=4 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Terraform
You can see complete commands with output here Terraform Output
$ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.access-create-accesskeys.aws_iam_access_key.demoaccesskeys will be created
+ resource "aws_iam_access_key" "demoaccesskeys" {
+ create_date = (known after apply)
+ encrypted_secret = (known after apply)
+ encrypted_ses_smtp_password_v4 = (known after apply)
+ id = (known after apply)
+ key_fingerprint = (known after apply)
+ secret = (sensitive value)
+ ses_smtp_password_v4 = (sensitive value)
+ status = "Active"
+ user = "demoaccesskeys-tf"
}
Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Warning: AWS account ID not found for provider
│
│ with provider["registry.terraform.io/hashicorp/aws"],
│ on provider.tf line 1, in provider "aws":
│ 1: provider "aws" {
│
│ See https://www.terraform.io/docs/providers/aws/index.html#skip_requesting_account_id for implications.
╵
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
module.access-create-accesskeys.aws_iam_access_key.demoaccesskeys: Creating...
module.access-create-accesskeys.aws_iam_access_key.demoaccesskeys: Creation complete after 2s [id=AKIA5EF0FEC8B9CF26EF]
╷
│ Warning: AWS account ID not found for provider
│
│ with provider["registry.terraform.io/hashicorp/aws"],
│ on provider.tf line 1, in provider "aws":
│ 1: provider "aws" {
│
│ See https://www.terraform.io/docs/providers/aws/index.html#skip_requesting_account_id for implications.
╵
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
AWS CLI
You can see complete commands with output here AWSCLI Output
$ cd awscli/
$ source ../../../providers/aws/setup.bash
$ ./access-create-accesskeys.bash
$ aws iam create-access-key --user-name=$CLOUD_USERNAME --profile=$PROFILENAME --region=$CLOUD_REGION --endpoint-url=$ENDPOINT_URL
{
"AccessKey": {
"UserName": "****",
"AccessKeyId": "AKIA****",
"Status": "Active",
"SecretAccessKey": "****************************************"
}
}