2017-05-10 4 views
0

Lors du déploiement sur Elasticbeanstalk, mon déploiement échoue avec une erreur d'analyse provoquée par un fichier .config que j'ai dans le dossier .ebextension, mais cela me semble correct. Quelqu'un peut me dire comment le réparer? Le fichier .config ressemble à ceci:Erreur AWS lors de l'analyse du fichier .config YAML dans .ebextension

files: 
    "/opt/elasticbeanstalk/hooks/appdeploy/post/01_copy_htaccess_after_deployment.sh": 
    mode: "000755", 
    owner: root, 
    group: root, 
    content: | 
     yes | /bin/cp /var/app/current/.htaccess.new /var/app/current/.htaccess 

Et l'erreur:

The configuration file .ebextensions/08_htaccess_create_script_post_deploy.config in application version git-bce52a5381c7ac6735249419c48b1fe116168610-1494415808045 contains invalid YAML or JSON. YAML exception: Invalid Yaml: while parsing a block mapping in "", line 3, column 10: mode: "000755",^ expected , but found FlowEntry in "", line 3, column 24: mode: "000755",^, JSON exception: Invalid JSON: Unexpected character (f) at position 0.. Update the configuration file.

Répondre

1

selon les Aws dcumentation vous ne devez utiliser comas derrière le propriétaire du mode et du groupe. de sorte que votre fichier de configuration YML devrait ressembler à ceci:

files: 
    "/opt/elasticbeanstalk/hooks/appdeploy/post/01_copy_htaccess_after_deployment.sh": 
    mode: "000755" 
    owner: root 
    group: root 
    content: | 
     yes | /bin/cp /var/app/current/.htaccess.new /var/app/current/.htaccess 

et voici un exemple de la syntaxe

files: 
    "target file location on disk": 
    mode: "six-digit octal value" 
    owner: name of owning user for file 
    group: name of owning group for file 
    source: URL 
    authentication: authentication name: 

    "target file location on disk": 
    mode: "six-digit octal value" 
    owner: name of owning user for file 
    group: name of owning group for file 
    content: | 
    this is my content 
    encoding: encoding format 
    authentication: authentication name: