Sfoglia il codice sorgente

switch to profiles

Chris Mague 7 anni fa
parent
commit
4a1bb1a339
2 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 1 0
      cookiecutter.json
  2. 3 2
      {{cookiecutter.packer_name}}/packer.json

+ 1 - 0
cookiecutter.json

@@ -13,6 +13,7 @@
   "dependencies": "https://github.com/shokunin/ansible_ec2_base,yatesr.timezone,bennojoy.ntp",
   "target_os": "ubuntu",
   "aws_region": "us-west-1",
+  "aws_profile": "shokunin-chris",
   "target_os_version": "xenial",
   "company_name": "Shokunin Consulting LLC"
 }

+ 3 - 2
{{cookiecutter.packer_name}}/packer.json

@@ -5,8 +5,6 @@
     {% endraw -%}
     "region"         : "{{ cookiecutter.aws_region }}",
     {% raw -%}
-    "aws_access_key" : "{{ env `AWS_ACCESS_KEY_ID` }}",
-    "aws_secret_key" : "{{ env `AWS_SECRET_ACCESS_KEY` }}"
  },
   "provisioners": [
     {
@@ -26,6 +24,9 @@
   "builders": [
     {
       "type"          : "amazon-ebs",
+    {% raw -%}
+      "profile"     : "{{ cookiecutter.aws_profile }}",
+    {% endraw -%}
       "access_key"    : "{{user `aws_access_key`}}",
       "secret_key"    : "{{user `aws_secret_key`}}",
       "region"        : "{{user `region`}}",