title: Cloudformation YAML !Sub !Ref error where two resource values require variable substitution
body: <p>In my S3 Policy the below lines</p>
  <pre><code>Resource:
   - !Sub 'arn:aws:s3:::website-${paramEnvironment}/*'
   - { Environment: !Ref paramEnvironment}
   - !Sub 'arn:aws:s3:::website-${paramEnvironment}'
   - { Environment: !Ref paramEnvironment}
  </code></pre>
  <p>produce <code>Invalid Policy Syntax</code></p>
  <p>I'm unable to locate an example YML where there are two resources declared with variable substitution, and I have attempted variants of the above based on <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html" rel="nofollow noreferrer">AWS docs</a>.</p>