-3

i would like create a secret with secret manager aws

more precisely create a secret for docker registry.

I would like to use terraform for that but i don't find a good code for that.

Does anyone have a concrete example

enter image description here

breizh5729
  • 174
  • 2
  • 9
  • 1
    What's wrong with the examples in the terraform [docs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret_version)? – Marcin Aug 14 '20 at 08:16
  • 1
    Just *create* the secret with terraform and set a value manually. Otherwise the secret is visible in the terraform state file and checked in in your source control, etc. – luk2302 Aug 14 '20 at 08:24
  • my container image for aws fargate is in a private repository in docker hub , – breizh5729 Aug 14 '20 at 08:28
  • how to configure docker credential in the task definition in the most secure way – breizh5729 Aug 14 '20 at 08:29

1 Answers1

-2
Please follow this link for extensive information about SSM though terraform

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter

You can use the following example

'resource "aws_ssm_parameter" "secret" {
   name        = "/production/database/password/master"
   description = "The parameter description"
   type        = "SecureString"
   value       = "secret_value"
   
   tags = {
   environment = "production"
   }
 }'