grrr-amsterdam / simply-static-deploy

WordPress plugin to deploy static sites easily to an AWS S3 bucket.
MIT License
68 stars 11 forks source link

Use IAM Roles instead credentials #41

Open satheler opened 3 years ago

satheler commented 3 years ago

My WordPress site is on EC2 on Amazon Web Services, have some way to use IAM Roles instead of credentials?

leonstafford commented 3 years ago

If it's not already in this repo, the devs can feel free to grab what we're using in WP2Static S3 Addon to do other AWS credential options, I think we handle profiles and roles.

HammenWS commented 3 years ago

@satheler I think you can configure your EC2 instance in such a way that you can access the static site s3 bucket via a role. In that case you can leave the aws key and secret empty.

satheler commented 3 years ago

@satheler I think you can configure your EC2 instance in such a way that you can access the static site s3 bucket via a role. In that case you can leave the aws key and secret empty.

Unfortunately not working 😕.

image

HammenWS commented 3 years ago

@satheler Where you define you SIMPLY_STATIC_DEPLOY_CONFIG the keys should be present. The values can be null, but the keys should be there.

define('SIMPLY_STATIC_DEPLOY_CONFIG', [
    'aws' => [
        'key' => '...', # AWS access key
        'secret' => '...', # AWS secret key
        'region' => '...', # AWS region
        'bucket' => '...', # S3 bucket
        'bucket_acl' => '...', # S3 bucket ACL (optional, defaults to `public-read`)
        'distribution' => '...', # CloudFront distribution ID (optional, step is skipped when empty)
        'endpoint' => '...', # For usage with providers other than AWS (optional)
    ],
    'url' => '...', # Website url (used for displaying url after deploy is finished)
]);