Um einen mehrzeiligen Text in Cloudformation Templates zu platzieren, gibt es eine elegante Lösung – der YAML >- Operator:
/var/www/html/public/index.php:
content: >-
<html>
<body>
<h1>Welcome to the AWS CloudFormation PHP Sample</h1>
<p/>
<?php
// Print out the current data and time
print "The Current Date and Time is: <br/>";
print date("g:i A l, F j Y.");
?>
<?php phpinfo(); ?>
</body>
</html>
Alternativ wird in vielen offiziellen Beispielen das sehr unhandliche Format mit der Join Funktion benutzt:
/var/www/html/index.php:
content: !Join
- ''
- - |
<html>
- |2
<body>
- |2
<h1>Welcome to the AWS CloudFormation PHP Sample</h1>
- |2
<p/>
- |2
<?php
- |2
// Print out the current data and time
- |2
print "The Current Date and Time is: <br/>";
- |2
print date("g:i A l, F j Y.");
- |2
?>
- |2
<?php phpinfo(); ?>
- |2
</body>
- |
</html>
