hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.77k stars 9.13k forks source link

Add support for AWS AppConfig #11973

Closed nerixim closed 3 years ago

nerixim commented 4 years ago

Community Note

Description

(snip) AppConfig, a new capability within AWS Systems Manager that makes it easy for customers to quickly roll out application configurations across applications hosted on EC2 instances, containers, Lambdas, mobile apps, IoT devices, and on-premise servers in a validated, controlled and monitored way. System administrators, DevOps engineers, and developers now have the ability to manage configuration changes, similar to the way they manage code, but without the need for deploying code or taking their application out of service when a configuration value changes, thus mitigating risk of potential outages.

New or Affected Resource(s)

Potential Terraform Configuration

resource "aws_appconfig_application" "this" {
  name = "sample"
  description = "just a sample"
  tags = {
    Name = "AppConfig Application"
  }
}

resource "aws_appconfig_configuration_profile" "this" {
  application_id = aws_appconfig_application.this.id
  name = "sample"
  description = "just a sample"
  location_uri = aws_ssm_parameter.this.arn | aws_ssm_document.this.arn | "https://ssm-url.aws"
  retrieval_role_arn = aws_iam_role.retrieve_ssm.arn
  validator {
    type = "JSON_SCHEMA" | "LAMBDA"
    content = "JSON Schema content or AWS Lambda function name"
  }
  tags = {
    Name = "AppConfig Configuration Profile"
  }
}

resource "aws_appconfig_deployment_strategy" "this" {
  name = "sample"
  description = "just a sample"
  deployment_duration_in_minutes = 15
  final_bake_time_in_minutes = 30
  growth_factor = 0.1
  growth_type = "LINEAR"
  replicate_to = "NONE" | "SSM_DOCUMENT"
  tags = {
    Name = "AppConfig Deployment Strategy"
  }
}

resource "aws_appconfig_environment" "this" {
  application_id = aws_appconfig_application.this.id
  name = "sample"
  description = "just a sample"
  monitors = [aws_cloudwatch_alarm.this.arn]
  tags = {
    Name = "AppConfig Environment"
  }
}

resource "aws_appconfig_deployment" "this" {
  application_id = aws_appconfig_application.this.id
  environment_id = aws_appconfig_environment.this.id
  deployment_strategy_id = aws_appconfig_deployment_strategy.this.id
  configuration_profile_id = aws_appconfig_configuration_profile.this.id
  configuration_version = "1"
  description = "just a sample"
  tags = {
    Name = "AppConfig Deployment"
  }
}

References

LechuckThePirate commented 3 years ago

Any news of when this will be available?

hstefanov commented 3 years ago

I am also waiting for this, but for now I am managing to workaround with a cloudformation stack as follows :

resource "aws_cloudformation_stack" "appconfig" { name = "appconfig-stack"

template_body = <<STACK { "Parameters" : { "AppName" : { "Type" : "String", "Default" : "helloworld", "Description" : "Name of the application" }, "EnvName" : { "Type" : "String", "Default" : "demo", "Description" : "Name of the environment" }, "ProfileName" : { "Type" : "String", "Default" : "ExclamationPoints ", "Description" : "Name of the profile" } }, "Resources" : { "appConfig": { "Type" : "AWS::AppConfig::Application", "Properties" : { "Name" : { "Ref" : "AppName" } } }, "appConfigEnv": { "Type" : "AWS::AppConfig::Environment", "Properties" : { "Name" : { "Ref" : "EnvName" }, "ApplicationId" : { "Ref" : "appConfig" } } }, "appConfigProfile": { "Type" : "AWS::AppConfig::ConfigurationProfile", "Properties" : { "Name" : { "Ref" : "ProfileName" }, "ApplicationId" : { "Ref" : "appConfig" } } } } } STACK }

LechuckThePirate commented 3 years ago

Yes that's my approach as well but I think it would be good to add it

El jue., 28 ene. 2021 9:38, Hristo Stefanov notifications@github.com escribió:

I am also waiting for this, but for now I am managing to workaround with a cloudformation stack as follows :

resource "aws_cloudformation_stack" "appconfig" { name = "appconfig-stack"

template_body = <<STACK { "Parameters" : { "AppName" : { "Type" : "String", "Default" : "helloworld", "Description" : "Name of the application" }, "EnvName" : { "Type" : "String", "Default" : "demo", "Description" : "Name of the environment" }, "ProfileName" : { "Type" : "String", "Default" : "ExclamationPoints ", "Description" : "Name of the profile" } }, "Resources" : { "appConfig": { "Type" : "AWS::AppConfig::Application", "Properties" : { "Name" : { "Ref" : "AppName" } } }, "appConfigEnv": { "Type" : "AWS::AppConfig::Environment", "Properties" : { "Name" : { "Ref" : "EnvName" }, "ApplicationId" : { "Ref" : "appConfig" } } }, "appConfigProfile": { "Type" : "AWS::AppConfig::ConfigurationProfile", "Properties" : { "Name" : { "Ref" : "ProfileName" }, "ApplicationId" : { "Ref" : "appConfig" } } } } } STACK }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hashicorp/terraform-provider-aws/issues/11973#issuecomment-768891752, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7A7N5G52X4CRJYVOP7DC3S4EO73ANCNFSM4KSBWIGA .

larstobi commented 3 years ago

SDK support is available since v1.25.42 https://github.com/aws/aws-sdk-go/pull/2977

LechuckThePirate commented 3 years ago

SDK support is available since v1.25.42 aws/aws-sdk-go#2977

Nope, not as far as I know

image

Not talking about "AWS Config", but "AWS AppConfig" ;)

larstobi commented 3 years ago

Nope, not as far as I know

But, in that link that I posted, you'll see this:

Release v1.25.42 (2019-11-25) Service Client Updates

  • service/alexaforbusiness: Updates service API and documentation
  • service/appconfig: Adds new service
marcomsousa commented 3 years ago

The support in this provider isn't available, but the AWS SDK yes it is since 2019-11. That's means that to implement this there is no blocker... just someone with time to implement this.

Add that this AWS App Config (Not AWS Config) is a must have it PaaS services for DevOps. AWS App Config is a central/global services you can save all your configuration inside for all the application.

Is not yet implemented maybe because this services is similar purpose (not the same) as Consul hashicorp (Key/Value Storage).

shuheiktgw commented 3 years ago

Let me see if I can implement this 👍

deepshah22 commented 3 years ago

Superlike...!!!! Would love to see some progress here. This is super helpful.

LechuckThePirate commented 3 years ago

Which TF CLI version will have support for this?

suzuki-shunsuke commented 3 years ago

Hi, I have sent pull requests to support AppConfig. To make pull request small, I split pull requests per resource.

19307 Application + Environment

19320 Configuration Profile

19324 Hosted Configuration Version

19359 Deployment Strategy

At first, please review #19307.

I think many users need this feature.

anGie44 commented 3 years ago

Hi all, the following resources have been merged and will be released with v3.50.0 of the TF AWS provider (likely out this Thursday):

Big shoutout out to @suzuki-shunsuke and @Isaiah-Turner for providing the implementations!

bryantbiggs commented 3 years ago

this is awesome, thanks a ton! it looks like the only resource we might be missing is aws_appconfig_deployment or did I miss that somewhere in there?

suzuki-shunsuke commented 3 years ago

AS a prototype, I send a pull request to support aws_appconfig_deployment. #20172

AppConfig Deployment doesn't support common CRUD API. Instead of common CRUD API, AppConfig Deployment supports the following API.

So I don't know how we should implement Update and Delete.

github-actions[bot] commented 3 years ago

This functionality has been released in v3.50.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

anGie44 commented 3 years ago

Hi All, noting here that the last resource aws_appconfig_deployment has been merged and will be available in today's release of v3.51.0 of the provider. Thanks again @suzuki-shunsuke for all your contributions 🎉

github-actions[bot] commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.