RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
277 stars 75 forks source link

Add AWS S3 bucket support #27

Open Sarafian opened 7 years ago

Sarafian commented 7 years ago

With the assumption that the AWSPowerShell module is installed.

With AWS S3 support we could download https://s3-eu-west-1.amazonaws.com/cloudformation-templates-eu-west-1/Windows_Single_Server_SharePoint_Foundation.template with something like this

something = @{
        DependencyType = 'AWS-S3'
        BucketName = 'cloudformation-templates'
        Region = 'eu-west-1' #Optional
        Key='Windows_Single_Server_SharePoint_Foundation.template'
    }

We need to consider authentication but as a first version we could it is setup on your profile with Set-AWSCredentials

RamblingCookieMonster commented 7 years ago

Cool idea! Any interest at taking a stab at this? Haven't used much AWS yet : )

Cheers!

Sarafian commented 7 years ago

Since I've created this issue I've already taken a look into the code. I understand where the actually dependency type implementation needs to be created but can you provide some insight for the rest of the source code? A couple of questions

I'm already working on something similar here. Once I finish this and I know a bit more I'll do the contribution.

Sarafian commented 7 years ago

Notes for the future. The cmdlet that will support this dependency is Copy-S3Object. Required parameters are:

All cmdlets in AWSPowerShell module define many optional parameters that drive the authorization. Optional parameters are:

Skipped the ones with credentials as they shouldn't be added to the configuration script. To decouple sensitive information from the configuration script, we need to define expressions that when invoked returned the intended object. For example for a property Credential we need a CredentialExpression that has the ability to return the intended value.

RamblingCookieMonster commented 7 years ago

Hi!

Gotcha:

Cheers!

Sarafian commented 7 years ago

Pull request available #30