Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence script to put data from Amazon Web Services (AWS)

Lee Pryor October 22, 2015

Hi.

Non programmer here willing to learn!  We currently host all of our servers in AWS and we are using confluence to document these.

What I would like to do is have use a template in confluence. You would create a new page based on the template, call the page the ec2 instance name and there would be fields in the template for ip, instance type, instance id etc that would be automatically populated.

What is the best approach to do this? I believe confluence has some scripting plugins but only support limited languages. AWS has SDK support for the following languages:

AWS SDK for Java
AWS SDK for JavaScript
AWS SDK for .NET
AWS SDK for PHP
AWS SDK for Python (boto)
AWS SDK for Ruby

I have full access to AWS as well as the confluence server.

Any tips or pointers would be greatly appreciated.

 

Thanks!

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 22, 2015

Documenting AWS resources via Confluence is a great idea that we have also been exploring for a bit already:

  • Utoolity is currently working on an automation solution for Confluence Cloud that will ultimately allow you to get those pages automatically created when you start a new instance. This might still take a few weeks though, and the subsequent Confluence Server release a bit longer even.

That being said, here's my take on your requirements - I think you are looking for a Confluence Blueprint, which gives users a way to create new pages based on pre-defined content:

Basic blueprints can simply help create new pages with pre-defined content from a template, static or dynamic. Blueprints don't limit you to just pre defining content and is really up to your imagination. You can take user input in a dialog wizard and pre populate content, settings or just develop templates with placeholder text (only visible in the editor) to assist users creating certain types of documents. 

Confluence Server pretty much implies that you want to use the AWS SDK for Java, because Confluence Server add-ons need to be written in Java themselves (or at least run on the JVM). For example, the Write an intermediate blueprint plugin tutorial requires you to create a simple implementation of a ContextProvider interface by extending the AbstractBlueprintContextProvider.The subsequent Write an advanced blueprint plugin tutorial shows how you can create a blueprint that populates its template with data

  • The JVM is a versatile platform that allows embedding different language runtimes as well, so if you really want to, you could also use the SDKs for JavaScript, Python or Ruby. However, from my experience this is not exactly the path of least resistance ...
  • An alternative might be to use the AWS SDK for JavaScript in the Browser and only retrieve the AWS resource data based on the information provided by the user during the Blueprint wizard. I haven't tried this yet though, and you also need to find an appropriate solution for providing AWS Security Credentials to the client side JavaScript without opening up a security hole (this is possible, but non trivial and easy to mess up, thus should be considered very carefully only).

If this is for internal usage only, you can get away with embedding AWS credentials in your add-on somehow. However, if you aim to publish the resulting add-on, you need to consider a more pronounced approach to AWS Security Credentials management.

  • For example, Utoolity offers a dedicated 'Identity Federation for AWS' add-on for Bamboo and JIRA, which allows you to add long-term AWS security credentials (IAM users) once and configure AWS access for Atlassian groups with temporary credentials and fine grained permissions via IAM Policies thereafter (please don't hesitate to get in touch, if you are interested in support for Confluence, we are always keen to learn more about new use cases and adjusting our roadmap accordingly). 

 

0 votes
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 22, 2015

@Lee Pryor - I'm crafting my answer currently: are you looking for a static solution (i.e. populate the fields once on page creation) or a dynamic solution (i.e. the fields would track the EC2 instance state).

0 votes
Lee Pryor October 22, 2015

We are running Confluence server.

0 votes
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 22, 2015

@Lee Pryor - are you aiming for Confluence Server or Confluence Cloud instances, or possibly both (the integration options are very different between these)?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events